Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Trigger :old and :new column values
Please bear with me, my question needs a bit of explanation !
I'm trying to write some "auditing" code in a TRIGGER which saves old and new values of particular columns on particular tables I'm interested in.......
I've got some code like this.....
CURSOR c1(pType VARCHAR2
) IS
which is followed a bit further on by....
FOR changes_rec IN c1(sType) LOOP
INSERT INTO AUDIT_CHANGES VALUES( AUDIT_CHANGES_SEQ.NEXTVAL, sType, changes_rec.COLUMNNAME,
*:old.ColumnName*, <--- Problem is here !
*:new.ColumnName*, <---
); END LOOP;
For each columnname returned in the c1 "INTERESTS" table query I want to save the OLD and NEW values in my AUDIT_CHANGES table,
How do I reference the column in the :old and :new records when I've only got the column's name in <changes_rec.ColumnName> ?! I figure I need some way of "Evaluating" :old.(changes_rec.ColumnName) but I can't find one....
Any suggestions ??
Dave
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Nov 24 1999 - 04:17:09 CST
![]() |
![]() |