Re: Access / ODBC / Sequences
From: John Verhoeven <johnv_at_acix.DIALix.oz.au>
Date: 1996/10/05
Message-ID: <johnv.0a67_at_acix.DIALix.oz.au>#1/1
Date: 1996/10/05
Message-ID: <johnv.0a67_at_acix.DIALix.oz.au>#1/1
In article dated Fri, 04 Oct 1996 11:56:47 +0300, Pulkrab Juergen (94104066_at_fhs-hagenberg.ac.at) wrote:
> Tony Scott wrote:
> > I've got Access connected to the Oracle tables I'm interested in via ODBC
> > but in order to input new records I need to be able to get the numbers
> > generated by an Oracle sequence. Can anyone tell me how I do this?
>
> Hi, Tony,
>
> try the following:
> SELECT MY_SEQUENCE.CURRVAL FROM DUAL;
> Don't use MY_SEQUENCE.NEXTVAL, the sequence will increase.
In a session, in order to be able find the currval from a sequence you must have already selected nextval from the sequence. This is documented in the SQL Reference manual I think.
Rather defeats the purpose of having currval, doesn't it?
-- _--_|\ John Verhoeven Unix / Database Administrator Westrail / \ johnv_at_DIALix.oz.au / jverhoeven_at_westrail.wa.gov.au *_.--._/ v "Smile! things could be worse... So I did... and they were..."Received on Sat Oct 05 1996 - 00:00:00 CEST