While executing the following database trigger (update) we are getting the
following error message
"ORA-01008:not all variables bound". We are working on Oracle 8.0.3

We have written this trigger to get the column name,old and new values of
fields of a  table (locmast) while updating.
We do not want to hard code the field names ,so that in future if a new
field is added we need not have
to alter the trigger.

declare
     v_rowid   varchar2(50);
          cursor cur_loc  is select column_name from all_tab_columns where
table_name='LOCMAST';
     v_val          varchar2(120);
     cur_id         number;
     v_rec_id  number;
begin
cur_id:=dbms_sql.open_cursor;
for rec_loc in cur_loc loop
        dbms_sql.parse(cur_id, 'select :old.'||rec_loc.column_name||' from
dual' ,dbms_sql.native);
      dbms_sql.define_column_char(cur_id,1,v_val,120);
      v_rec_id := dbms_sql.execute_and_fetch(cur_id);
      dbms_sql.column_value_char(cur_id,1,v_val);
end loop;
end;

Thanks
Deepa


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to