Sequence nextvalue

wkd24154

Member²
If I use a TOracleDataSet component to select the nextvalue of a sequence I`ll only get every second number. What could be the reason (if I use a query with the same select statement it`s works)?
 
That's hard to say. The nextval probably is queried twice. To find out, use the Oracle Monitor to verify the statements that are executed during the creation of this record.
 
Could it be that in your TOracleDataSet you've set the CountAllRecords to TRUE ? If so, then before the execution of the TOracleDataSet's SQL the "Select Count(*) from (TOracleDataSet.SQL)" is being executed. If your TOracleDataSet.SQL is something like "Select MySequence.NextVal From Dual" then the "MySequence.NextVal" is being called twice. Just a thought..
 
Thanks for your reply. My mistace was this one: I create a new function to execute a sql statement. At first I set ExecSQL and if the sql text contains the select statement I set the DataSet to active.
 
Back
Top