Home » SQL & PL/SQL » SQL & PL/SQL » error of bad bind variable
error of bad bind variable [message #2150] Mon, 24 June 2002 23:42 Go to next message
keane
Messages: 23
Registered: June 2002
Junior Member
Hi, I try to assign one column name to a variable and use this variable to retrieve the value, but failed.
the original code is
create or replace trigger test is
after insert on rel1
for each row
declare
column_name varchar2(20);
begin
column_name := 'col1'; -- col1 is one column of rel1
dbms_output.put_line(:new.column_name);
end;

The error is bad bind variable, :new.column_name. I don't want to use :new.col1 directly because I want to get a general form. So can anyone help me? thanks a lot.
Regards,
keane
Re: error of bad bind variable [message #2154 is a reply to message #2150] Tue, 25 June 2002 02:18 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
u should use
either column_name := :new.col1 -- for new values
or
either column_name := :old.col1 -- for old values
Previous Topic: Re: Question
Next Topic: Re: Question
Goto Forum:
  


Current Time: Thu Apr 18 22:04:37 CDT 2024