On Sun, May 11, 2003 at 14:11:01 +1000, Matthew Horoschun <mhoroschun@canprint.com.au> wrote:
> Hi All,
>
> Is there any way to know ahead of time whether calling currval() on a
> sequence will cause an exception like:
>
> ERROR: some_id_seq.currval is not yet defined in this session
>
> In my function I can't be sure whether nextval() will have previously
> been called in the session.
Well you could just call nextval at the start of the session to make sure
it has a value.
Howvere it is odd that you would want to call currval when there may not
have already been a call to nextval. What are you doing with the returned
value?