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: ORacle 8 or 9 Trigger Compile error help please

Re: ORacle 8 or 9 Trigger Compile error help please

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Thu, 13 Jul 2006 14:31:18 GMT
Message-ID: <J2CJ08.2Cy@igsrsparc2.er.usgs.gov>


relipse_at_gmail.com wrote:
> Here is my trigger below!!! please help with those compile errors!!
>
> SQL> CREATE OR REPLACE TRIGGER trg_insertreg19toreg20
> 2 INSTEAD OF INSERT ON BD_REGISTRATIONS1_9_VIEW
> 3 FOR EACH ROW
> 4 BEGIN
> 5 INSERT INTO BD_REGISTRATIONS (REG_USER_ID, REG_BLDRV_ID,
> REG_DONATESCHTIME,
> 6 REG_DONORWALKIN, REG_DONATEACTTIME, REG_DONOREXCUSED,
> REG_REIMBURSED, REG_THANKYOUSENT)
> 7 VALUES (:NEW.REG_USER_ID,
> 8 :NEW.REG_BLDRV_ID,
> 9 :NEW.REG_DONATESCHTIME,
> 10 :NEW.REG_DONORWALKIN,
> 11 :NEW.REG_DONATEACTTIME,
> 12 :NEW.REG_DONOREXCUSED,
> 13 :NEW.REG_REIMBURSED,
> 14 :NEW.REG_THANKYOUSENT
> 15 );
> 16 IF (:NEW.REG_VOLSCHTIME IS NOT NULL) THEN
> 17 INSERT INTO BD_VOLUNTEERTIMES (VT_ID, VT_USER_ID,
> VT_BLDRV_ID, VT_SCHTIME, VT_ACTTIME,
> VT_EXCUSED)
> 18 VALUES( SEQ_VT_ID.NEXT,
> 19 :NEW.REG_USER_ID,
> 20 :NEW.REG_BLDRV_ID,
> 21 :NEW.REG_VOLSCHTIME,
> 22 :NEW.REG_VOLACTTIME,
> 23 :NEW.REG_VOLEXCUSED
> 24 );
> 25 END IF;
> 26 END;
> 27 /
>
> Warning: Trigger created with compilation errors.
>
> Errors for TRIGGER TRG_INSERTREG19TOREG20:
>
> LINE/COL ERROR
> --------
> -----------------------------------------------------------------
> 14/10 PL/SQL: SQL Statement ignored
> 15/31 PLS-00302: component 'NEXT' must be declared

The PLS-302 error is your problem. In your code above, look at line 18 you are inserting a value into a column:

 >  17           INSERT INTO BD_VOLUNTEERTIMES (VT_ID, VT_USER_ID,
 > VT_BLDRV_ID, VT_SCHTIME, VT_ACTTIME,
 >  VT_EXCUSED)
 >  18              VALUES( SEQ_VT_ID.NEXT,

Oracle is telling you that it does not know what SEQ_VT_ID.NEXT is. Is SEQ_VT_ID a sequence? If so, then you should have SEQ_VT_ID.NEXTVAL instead.

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Thu Jul 13 2006 - 09:31:18 CDT

Original text of this message

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