:new and :old

  • From: Kean Jacinta <jacintakean@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 16 Jun 2005 05:47:54 -0700 (PDT)

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;
  




                
__________________________________ 
Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 
http://discover.yahoo.com/online.html
--
//www.freelists.org/webpage/oracle-l

Other related posts: