![]() |
Oracle sequences and VB problems
Hi guys:
I've met the following issue. We've created some sequences with this code: CREATE SEQUENCE SQ_TR_HQPROJECT MINVALUE 13 MAXVALUE START WITH 13 INCREMENT BY 1 Right, while using TOAD or SQLPlus the sequence seems to work properly: SQL> select SQ_TR_HQPROJECT.nextval from dual;But when we implement in our program the increment is by 2 not by 1: Const SqlCodFiltro As String = "SELECT SQ_TR_HQPROJECT.NEXTVAL FROM dual"The first time we run the procedure returns 23 and the second one 25. Can anyone hepl us with this problem. Thanks in advance. |
Re: Oracle sequences and VB problems
This will be because you're running the query twice. Enable SQL*Net tracing, then step through the code in the debugger and watch the trace file in an editor (you may need to reopen the trace file each step to see what's new, depending on which editor you use). Then you will be able to see where the extra run occurs.
I checked with Oracle 10.2.0.3, using OLE DB 10.2.0.2.20 and the following code: Code:
Dim oCon As ADODB.Connection |
Re: Oracle sequences and VB problems
Thank you very much.
As soon as I test your solution I'll let you know |
| All times are GMT +5.5. The time now is 06:00. |