Solved

Instead of delete -  triggers

Posted on 2007-11-20
6
464 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 500 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
Technology Partners: 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!

 
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

Industry Leaders: 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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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

695 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