Home » SQL & PL/SQL » SQL & PL/SQL » bind variable parsing in execute immediate
bind variable parsing in execute immediate [message #248156] Thu, 28 June 2007 03:25 Go to next message
RAY_HT
Messages: 153
Registered: May 2005
Location: Giza
Senior Member

dear all experts

i have create trigger to update table with values from the record which fired the trigger like " :new.columnname"
but the columnname is returned from cursor , so i'm using execute immediate to execute update statment with the value of new value of the returned column .
may my words not cleared so please find attached trigger .
please it's urgent
  • Attachment: trigger.sql
    (Size: 1.26KB, Downloaded 200 times)
Re: bind variable parsing in execute immediate [message #248179 is a reply to message #248156] Thu, 28 June 2007 04:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can't do that.
Moreover it will failed some day.
If you have multiple updates to so in one shot, use a procedure to make all the updates.

Triggers make the things behind the scene and you don't know how it happens. Just don't do with triggers.
You a have a logic of your update, put it in a procedure and call the procedure instead of using the update statement.

Regards
Michel
Re: bind variable parsing in execute immediate [message #248204 is a reply to message #248179] Thu, 28 June 2007 04:43 Go to previous messageGo to next message
RAY_HT
Messages: 153
Registered: May 2005
Location: Giza
Senior Member

if i create procedure i will face the same problem
how to make it dynamic
i want to update more than one row each column returned from the cursor with each value return from updated row in trigger
Re: bind variable parsing in execute immediate [message #248238 is a reply to message #248204] Thu, 28 June 2007 06:55 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is a bad design but you can do it.

Regards
Michel
Previous Topic: Timestamp Query
Next Topic: Sql Query
Goto Forum:
  


Current Time: Sat Dec 10 01:17:31 CST 2016

Total time taken to generate the page: 0.06650 seconds