Re: Using sequence.nextval with OCI
From: Joost Bataille <bataille_at_ic.uva.nl>
Date: Sat, 21 Jul 2001 21:54:57 GMT
Message-ID: <9gntlc$ds9$1_at_mail.ic.uva.nl>
Date: Sat, 21 Jul 2001 21:54:57 GMT
Message-ID: <9gntlc$ds9$1_at_mail.ic.uva.nl>
Hello Mike,
your 'somesequence' could be created with an increment of 20.
Or it is created with a cache of 20 wich is meant to make it faster, AFAIK.
These 20 numbers are stored in memory for the duration of the session. If
the session is closed, the numbers are lost.
Try to recreate your sequence with the nocache option and don't supply an
increment option.
create sequence somesequence
start with <the right value!>
nocache
Greetings, Joost
-- Joost Bataille "Mike Watson" <mwatson_at_molecularmining.com> wrote in message news:13a3dd68.0106190703.5ef88f53_at_posting.google.com...Received on Sat Jul 21 2001 - 23:54:57 CEST
> I am using OCI to connect and retrieve records from our Oracle
> database. I use the "select somesequence.nextval from dual" to get a
> unique number. The problem is that for some reason my "nextval" is
> being incremented by 20 and not 1. On the SQL command line the
> statement works fine. It is only when I use it in my C++ program via
> Oracle Call Interface that the incrementation is multiplied by 20. I
> tested this by setting my increment value to 20. When I did this my
> "nextval" numbers were now 400 apart. Any ideas? Thanks
>
> Mike