I'm planning on using SQL 'sequences' for serializing a reference table and am researching their use. The examples given on page CREATE SEQUENCE - SAP HANA SQL and System Views Reference - SAP Library list the results expected, but on my HANA test, the values returned by the SELECT after the " INSERT INTO target VALUES ( seq.NEXTVAL, seq.NEXTVAL)" statement are "12, 12" and not "12, 13" as described. It appears that the second NEXTVAL invocation in the statement does not cause the sequence to be incremented. My HANA is at SPS09, version 1.00.091 (an older SPS06 server responds identically).
Is the example correct? I can see why *not* incrementing the sequence would make sense, otherwise a mix of NEXTVAL (for the first one) and CURRVAL (for subsequent uses in the same statement) would be required. I've searched the KB and find no bug describing an error with these symptoms. If the actions of the SQL processor are valid, then please update the example given in the SAP Library.
Thanks,
Donn
Request clarification before answering.
This is a known docu-bug!
The example in the documentation is wrong. NEXTVAL gets evaluated once per record in a statement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.