Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Automating Trigger creation for a table?

Automating Trigger creation for a table?

From: <newopt_at_my-deja.com>
Date: Mon, 14 Feb 2000 17:58:38 GMT
Message-ID: <889fob$rvm$1@nnrp1.deja.com>


I created the script below to automate the process of creating a universal trigger for a set of tables that I am loading. I keep getting a bind variable "NEW" not declared error. Any help would be appreciated!

SQL> get trigger.sql
  1 Declare
  2 cid INTEGER;
  3 v_tablename Vchar2(10);
  4 -- This procedure is used to create the trigger to preload the ICOMS
  5 -- NCR table.
  6 procedure create_trigger (v_trigger_tablename Varchar2(10)) IS   7 BEGIN
  8 CREATE OR REPLACE
  9 TRIGGER PRELOAD_TRIGGER
 10 BEFORE INSERT
 11 ON v_trigger_tablename
 12 FOR EACH ROW
 13 BEGIN
 14 SELECT seq_number_next.NEXTVAL INTO :new.seq_number FROM DUAL;  15 END;
 16 END create_trigger;
 17 -- Mainline Processing
 18 BEGIN
 19 -- Load the CBI0REP Table

 20     v_tablename := 'cbi0rep';
 21     create_trigger(v_tablename);

 22* END;
 23 /
Bind variable "NEW" not declared.
SQL> Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Feb 14 2000 - 11:58:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US