Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Dynamically referencing fieldnames in table trigger
Tried badly to explain myself last time so I'll try again. Here's the
code body for an After Update Trigger
Begin
declare
cursor c is
select colname from my_table_columns where tablename = 'MY_TABLE' and auditflag = 'Y'; -- so cursor c brings back a list of all --fieldnames to be checked in case they have beenupdated
currcolname table_columns.colname%type; -- to hold the field name
begin
for my_rec in c
loop
Now if currcolname is Surname I need the line to read
if :NEW.Surname != :OLD.Surname then instead of currcolname. So the IF statement needs to be dynamic. Any ideas
Thanks in advance
Fraser Received on Wed Aug 18 1999 - 03:27:50 CDT
![]() |
![]() |