Re: Problem with Oracle queries

From: Pablo J. Pedemonte <ppedemonte_at_luminaamericas.com.ar>
Date: Fri, 28 Sep 2001 13:43:42 GMT
Message-ID: <i8%s7.2524$Qv.89124_at_news.easynews.com>


"Robert Boyle" <rboyle_at_cyantel.com> wrote in message news:8729a6fe.0109270543.1b6f0916_at_posting.google.com...
> Are you trying to return the sequence with the SELECT statement? Why?
>
> If you have a trigger (do you, because it doesn't seem like you do)
> the trigger would do a SELECT sequence.NEXTVAL INTO unique_fieldname
> FROM DUAL;
That's exactly what the trigger does.

>and you do not then need to explicitly write this statement.

I'm affraid I'm missing the point, or perhaps I didn't explain myself clearly.
I need to perform an insertion from Java, and to retrieve the sequence's currval after the insertion.

How can I do it (always from Java) without the SELECT after the INSERT statement? The trigger's SELECT just set the sequence's NEXTVAL, it doesn't return such value to Java! That's why I need to execute a SELECT from Java following the INSERT.

Because Oracle refuses to execute two statements separated by a semicolon, I 'm looking for an alternate way to do it...

Pablo Received on Fri Sep 28 2001 - 15:43:42 CEST

Original text of this message