hi,
Im trying to make a trigger that monitors the deletes and updates on a table. I will use this design for many tables so Im trying to make it as dynamic as posible.
Im trying to build a dynamic query the following way:
colnames is an array(datatype)
squery varchar(1000)
colnames:= getcolnames( updatedtablenam e )
for cont 1..colnames.con t
squery:='insert into Auditor_table(c ol1,col2,col) values (:new.'||colnam es(cont)||',old .'||colnames(co nt)||','UPDATE' )';
execute inmmediate squery
I get an error on executing time telling me that the variable was not bound,
i dont know if dynamic SQL is able to get the values of :new or :old like this
any body have an idea? or a different way to do this?
Im trying to make a trigger that monitors the deletes and updates on a table. I will use this design for many tables so Im trying to make it as dynamic as posible.
Im trying to build a dynamic query the following way:
colnames is an array(datatype)
squery varchar(1000)
colnames:= getcolnames( updatedtablenam e )
for cont 1..colnames.con t
squery:='insert into Auditor_table(c ol1,col2,col) values (:new.'||colnam es(cont)||',old .'||colnames(co nt)||','UPDATE' )';
execute inmmediate squery
I get an error on executing time telling me that the variable was not bound,
i dont know if dynamic SQL is able to get the values of :new or :old like this
any body have an idea? or a different way to do this?
Comment