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

Home -> Community -> Usenet -> c.d.o.server -> Re: Setting up trigger problem

Re: Setting up trigger problem

From: Richard Spee <rhpspee_at_wxs.nl>
Date: Wed, 12 Jun 2002 23:09:30 +0200
Message-ID: <ae8do4$h6n$1@reader07.wxs.nl>


the only thing I did the make your script create the trigger from sqlplus was adding a /. Tried running the script from TOAD version 6.3.11.1. All objects are created!

"Aaron Rouse" <aaron_rouse_at_yahoo.com> wrote in message news:a57b6daf.0206121227.354f8911_at_posting.google.com...
> I am trying to figure out when I execute the below the trigger does
> not get created. This is a script that I ran on my last project and
> do not recall having any problems. When I try to run this in Toad it
> pops up with a "Variables" window and wanting me to define a Value for
> the Variable named ":NEW" and when I run it in SQL Plus I get no
> error, but no trigger is made:
>
> create table PICKLISTS (
> ID NUMBER(8) NOT NULL,
> TYPE VARCHAR2(100) NOT NULL,
> VALUE VARCHAR2(250) NOT NULL,
> LOCID NUMBER(8) DEFAULT 0 NOT NULL,
> SORTORDER NUMBER(8) NULL,
> SITENAME VARCHAR2(50) NULL,
> PRIMARY KEY (ID)
> );
>
> create sequence SEQ_PICKLISTS
> INCREMENT BY 1
> START WITH 1
> NOMAXVALUE
> MINVALUE 1
> NOCYCLE
> CACHE 20
> NOORDER;
>
> create or replace trigger TRG_PICKLISTS
> BEFORE INSERT ON PICKLISTS
> REFERENCING OLD AS OLD NEW AS NEW
> FOR EACH ROW
> DECLARE
> x INTEGER;
> BEGIN
> IF :new.ID is null THEN
> SELECT SEQ_PICKLISTS.NEXTVAL INTO x FROM DUAL;
> :new.ID := x;
> END IF;
> END;
Received on Wed Jun 12 2002 - 16:09:30 CDT

Original text of this message

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