Click to See Complete Forum and Search --> : PLS-00049: bad bind variable


ramkrish72
08-18-2004, 12:03 AM
Hi,
I'm getting this error PLS-00049: bad bind variable 'OLD.USER_ID' when i execute this trigger.Pls do let me know whats wrong in this trigger.The syntax of the trigger is as follows:

CREATE OR REPLACE TRIGGER MRM2A.TR_PRE_UPD_CUS_MSTR_PIN BEFORE UPDATE OF INT_ID,PRG_CD,PIN, PIN_STATUS_IND,
PIN_EXP_IN_DAYS ON MRM2A.CUS_MSTR_PIN REFERENCING OLD AS Old NEW AS New FOR EACH ROW
Begin
if nvl(:old.int_id,'x') <> nvl(:new.int_id,'x') then
insert into cus_mstr_pin_aud(fld_id, dt_time_stamp, upd_del_ind, audit_user_id, user_id, old_value, new_value)
values ('INT_ID', sysdate, 'U', pa_audit.user_id, :old.user_id, :old.int_id, :new.int_id);
end if;
I have 2 tables one normal table and another is an audit table.
Your suggestions are greatly appreciated.
Thanks,

Vikas Verma
08-18-2004, 05:37 AM
i think u've missed the : before OLD

DaPi
08-18-2004, 06:08 AM
Where does "pa_audit.user_id" come from?

Vikas Verma
08-18-2004, 07:17 AM
what is the structure of both tables?