I was looking into the mailling list archives about obtaining the
current value of a given sequence and stumbled on this posting:
http://listserv.sap.com/pipermail/sapdb.general/2000-November/005922.html
I tried it out on my own database , I seemed to get four values for the
current sequence value. The values are identical and fortunately a
select distinct will fix this. Should a select from the
sequence_name.currval return more than one row ?
Here's my select statement :
SELECT MSGIDSEQ.CURRVAL FROM MESSAGEQUEUE
Here's my table structure :
CREATE TABLE "SMSBILL"."MESSAGEQUEUE"
(
"MSGID" Integer,
"MSGBODY" Varchar (160) ASCII NOT NULL,
"MSGOWNER" Varchar (50) ASCII NOT NULL,
"MSGTIMESTAMP" Timestamp NOT NULL,
"DLR" Integer,
"RECIPIENT" Varchar (20) ASCII NOT NULL,
"SENDER" Varchar (20) ASCII NOT NULL,
PRIMARY KEY ("MSGID")
)
And finally here's my sequence:
CREATE SEQUENCE "MSGIDSEQ" INCREMENT BY 1 MINVALUE 1 MAXVALUE
99999999999999999999999999999999999999 NOCYCLE CACHE 100 ORDER
Comments and suggestions would be nice, thanks in advance.
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general
- RE: Current value of sequence. Peng Tuck Kwok
- RE: Current value of sequence. Zabach, Elke
