By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,592 Members | 2,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,592 IT Pros & Developers. It's quick & easy.

Getting next val in a sequence when the table is empty

P: n/a
Hi All,

I want to get the next val in a sequence and then use it to do an
insert. I can do this to get the next val:

select NEXTVAL for EAIDATA.SUPPLIER_TP_SEQ_NO from EAIDATA.SUPPLIER_TP;

But if EAIDATA.SUPPLIER_TP is empty, this fails - "0 records selected".
How can I get the next value of a sequence without referring to a
table?

Kind regards,

Rob
:)

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Values NEXTVAL for EAIDATA.SUPPLIER_TP_SEQ_NO

Nov 12 '05 #2

P: n/a
p175 wrote:
Values NEXTVAL for EAIDATA.SUPPLIER_TP_SEQ_NO


SELECT NEXTVAL FOR EAIDATA.SUPPLIER_TP_SEQ_NO FROM sysibm.sysdummy1

This table always has a single row.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.