Home » SQL & PL/SQL » SQL & PL/SQL » ORA-04088: error during execution of trigger
ORA-04088: error during execution of trigger [message #46612] Thu, 17 June 2004 04:33 Go to next message
Pansou
Messages: 3
Registered: June 2004
Junior Member
Hello,

I have created the trigger

CREATE OR REPLACE TRIGGER TR_A BEFORE UPDATE ON A REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW

when i execute the statement: select  LINK_ID from A where A.ID=:NEW.ID;

in the body of the trigger i get the ORA-04088 error.

Question: Does  this happen because i select from the same table? because if i comment out this line no error occurs.

Any solution?

Regards,

Pansou. 
Re: ORA-04088: error during execution of trigger [message #46613 is a reply to message #46612] Thu, 17 June 2004 05:33 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8024
Registered: November 2002
Location: California, USA
Senior Member
Correct. You cannot select from the table that the trigger is on, within that trigger. If you are trying to get the link_id from the row being updated, you can just use :new.link_id. Otherwise, you need to post more details of the problem for an alternative solution to be provided.
Re: ORA-04088: error during execution of trigger [message #46615 is a reply to message #46612] Thu, 17 June 2004 14:23 Go to previous messageGo to next message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
btw, I don't see what REFERENCING OLD AS OLD NEW AS NEW is intended to achieve.
Re: ORA-04088: error during execution of trigger [message #46618 is a reply to message #46612] Thu, 17 June 2004 20:08 Go to previous messageGo to next message
pulkit
Messages: 18
Registered: April 2004
Junior Member
HI

I think this is a new table that contains no data so when trying to select before update it returns no data found and fails at execution time.

Still you can not select from the same table when doing any DML transaction as it will return Mutating table error. There are many solutions to this error like making temporary tables.

Pulkit
Re: ORA-04088: error during execution of trigger [message #46622 is a reply to message #46615] Fri, 18 June 2004 00:48 Go to previous messageGo to next message
Pansou
Messages: 3
Registered: June 2004
Junior Member
Hello my friend,

Bellow is the definiton of the trigger:
CREATE OR REPLACE TRIGGER TR_UPDATE_GEN_STRUCTURE BEFORE UPDATE ON GEN_STRUCTURE REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW

GEN_STRUCTURE(SN,DESCRIPTION, LINK_ID,PARENT_SN)

The problem is that is not allowed select statement (select link_id from gen_structure where parent_sn=:NEW.SN) from the GEN_STRUCTURE table inside the trigger.
Another user wrote me to use a temporary table. This is a solution meaning to select from temp table instead of gen_structure & at the end of the trigger to update the temp table in order to synchronize them.
Also, i need to create a trigger for insert/delete to insert into/delete from temp table.
Another solution is to create a materialize view on gen_structure but this may cause problems because i get probe:timeout when i am testing the trigger.
Re: ORA-04088: error during execution of trigger [message #46638 is a reply to message #46622] Sat, 19 June 2004 05:49 Go to previous messageGo to next message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
That does not appear to be a valid trigger definition.

I assume GEN_STRUCTURE(SN,DESCRIPTION, LINK_ID,PARENT_SN) is a procedure call? What are SN, DESCRIPTION etc?
Re: ORA-04088: error during execution of trigger [message #46643 is a reply to message #46638] Sun, 20 June 2004 22:43 Go to previous message
Pansou
Messages: 3
Registered: June 2004
Junior Member
GEN_STRUCTURE is the table and SN,DESCRIPTION, LINK_ID,PARENT_SN are the columns
Previous Topic: Query
Next Topic: sql
Goto Forum:
  


Current Time: Fri Dec 26 01:20:21 CST 2014

Total time taken to generate the page: 0.08147 seconds