Solved

Instead of delete -  triggers

Posted on 2007-11-20
6
462 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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 video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

733 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