Re: Trigger Help for Oracle newbie...
Date: Wed, 02 Jun 1999 16:58:52 GMT
Message-ID: <375563FE.F7D6487B_at_sympatico.ca>
Answer inline
Wayne C. Wilson wrote:
> Hi,
>
> I am pretty new to Oracle (we have 8i) and am trying to write my first
> trigger; it compliles with error and then fails when it executes. First of
> all, after I compile it in SQL*PLUS and it tell me I have errors, how can I
> see the errors?
Try : SHOW ERRORS
> Secondly, here is my trigger, can you see any obvious
> errors? (the MTDB schema is valid, as is the column ID and table name
> TEAMS).
>
> CREATE OR REPLACE TRIGGER MTDB.TEAMS_INSERT
> BEFORE INSERT ON MTDB.TEAMS
> FOR EACH ROW WHEN (new.ID = 0)
> BEGIN
> ID := TEAMS_SEQ.NEXTVAL;
Try :select teams_seq.nextval
into :new.id
from dual;
> END;
>
> TEAMS_SEQ.NEXTVAL should be valid, but just to be sure I also tried setting
> ID to 10000.
>
> Any help would be appreciated.
>
> --Wayne
++Marc Received on Wed Jun 02 1999 - 18:58:52 CEST