Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> :new and :old
Hi,
i have declare a cursor in my trigger called cur1. I am trying to refer :OLD.<dynamicfieldname> :NEW.<dynamicfieldname> from the cursor. I got an error
PLS-00049 bad-bind variable. I am not sure if oracle support this. If this way is not gonna work then what can you pls suggest other method to acheive the same result.
THank YOU
JKean
Declare
CURSOR cur1 IS
SELECT FIELDNAME
FROM TRACKFLD WHERE TRACKTABLENAME = 'COMPANY_MASTER'
Begin
FOR cur1_rec IN cur1
LOOP
INSERT INTO AUDITLOG
(FIELDNAME,AUDITBEFOREVALUE,AUDITAFTERVALUE)
VALUES
(:FIELDNAME,:OLD.cur1_rec.FIELDNAME,:NEW.cur1_rec.FIELDNAME);
END LOOP;
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Jun 16 2005 - 08:53:03 CDT
![]() |
![]() |