QUESTION POSED ON: 13 November 2006
I am trying to use NDS or dynamic SQL in an update trigger to extract the value of the :new and the value of :old for a given column.
Consider the following example. I have a table T with these 20 fields:
x1 varchar2(32)
x2 number (16)
x3 date
......
The column names are in a dynamic array called colnameList. When the trigger fires, for each record, I want to call a stored procedure with column
name, value of the old and new for the column :new.X1, :old.X1:
Procedure (colnameList(i),:new.||'colnameList(i),:old.||colnameList(i))
I tried to extract the value like this:
execute immediate 'select '||':new'||'.'||colmnames(i)||' from dual'
into tmpVarn;
but it won't work.
|