Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie sequence problem.
Tom Redfern <herald_at_jeeves.seaxslug.org> schrijfbewerkingen: >
>
> All I find about sequences states that a sequence CURRVAL
> should be available to everything except "as columns", "in subqueries",
> and a few other circumstances. No mention of being unavailable to
> triggers. The realavant sequence works for inserts, but the
> following trigger failes at compile time without ora-.. error message:
>
> CREATE OR REPLACE TRIGGER trigger1 AFTER INSERT ON table1
> DECLARE varialbe1 table1.primarykey%TYPE;
> BEGIN
> variable1 := table1SequenceID.CURRVAL;
> ... code that works if variable 1 is substituted
> END;
>
> The offending line is the second line. Remove it, and the
> whole thing works. Any clues?
>
> Note the sig below if your going to reply via mail. Sorry, but I'm on
> uucp.
>
> Thank you for any help.
>
> \\ ~ ~ //
> ( @ @ )
> ===============-oOOo-(_)-oOOo-==================
> Red Hat Linux! Where I really went today!
> Please send personal replies to the address
> derived by removing the "x" from the
> following address: thos_at_jeeves.seaxslug.org
> =========================-Oooo.-================
> .oooO ( )
> ( ) ) /
> \ ( (_/
> `'
>
Hi there,
In a session, before you can reference CURRVAL you first have to reference NEXTVAL (otherwise you get ORA-8002)
Your welcome,
Jaap W. van Dijk Received on Fri Feb 27 1998 - 00:00:00 CST
![]() |
![]() |