Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Instead of delete -  triggers

Posted on 2007-11-20
6
Medium Priority
?
466 Views
Last Modified: 2013-12-19
Hi Experts ..

Is it possible to pass parameters to trigger from stored procedure??

I have instead of delete trigger on a *view*, this trigger delete a record from Table1 and insert record in table2, I want to pass parameters (other than the parameters used to delete record in table1)  used to insert a record in Table 2 table.

Is that still possible?
0
Comment
Question by:DrAske
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 7

Accepted Solution

by:
multithreading earned 2000 total points
ID: 20321998
No, at least not directly, and if you do it indirectly you are asking for trouble, because there would be many cases where the delete would happen without your indirect path having been setup.
0
 
LVL 9

Author Comment

by:DrAske
ID: 20322011
could you please explain a little more about the *indirect* approach??
0
 
LVL 7

Expert Comment

by:multithreading
ID: 20322025
No. It's WAY too scary.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 9

Author Comment

by:DrAske
ID: 20322053
nice answer :o)

could you please tell me why the following does not work??

In the stored procedure:

Delete from View1 where field1_id = p_field_id and field2 = p_field2 and field3 = p_field3;

in Instead of DELETE trigger on View1

{{

Delete from tabl1 where field_id = :old.field1_id;

insert into table2(field2, field3) values(:new.field2, :new.field3);

}}

0
 
LVL 7

Expert Comment

by:multithreading
ID: 20322181
Is "tabl1" the underlying table for View1?

If so, you have a recurisve trigger.
0
 
LVL 9

Author Comment

by:DrAske
ID: 20322209
View1 is a  join for more 3 tables.

thank you for your help :o)
Regards,
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question