Solved

Instead of delete -  triggers

Posted on 2007-11-20
6
459 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to recover a database from a user managed backup

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now