Home » SQL & PL/SQL » SQL & PL/SQL » Reference complete new-row in trigger (merged 2) (Oracle 11GR1)
Reference complete new-row in trigger (merged 2) [message #441791] Wed, 03 February 2010 02:25 Go to next message
jetyt
Messages: 1
Registered: February 2010
Junior Member
Hello,

I'd like to call a procedure from an instead of trigger and use the complete new-line as an argument like

create or replace TRIGGER some_trigger
instead of insert or delete or update on myTable
begin

if inserting then
  package.procedurename(new);
end if;


This doesn't seem to work and I don't want to explicitly declare a

v_myTable = myTable%ROWTYPE;


and then step through every single column using

v_myTable.a = :new.a;
v_myTable.b = :new.b;


because there are a lot of columns and I'd like to keep the trigger readable.
Re: Reference complete new-row in trigger [message #441792 is a reply to message #441791] Wed, 03 February 2010 02:27 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Sorry - I don't think there's a way of doing this.
Re: Reference complete new-row in trigger (merged 2) [message #441801 is a reply to message #441791] Wed, 03 February 2010 03:03 Go to previous message
Michel Cadot
Messages: 63804
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I confirm you cannot use/pass :new variable, you have to either build a record and copy each field or pass each field to the procedure.

Regards
Michel
Previous Topic: problem with SQL CREATE TABLE
Next Topic: question about foreign keys
Goto Forum:
  


Current Time: Mon Sep 26 21:28:22 CDT 2016

Total time taken to generate the page: 0.13368 seconds