If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 Sequence Object PREVVAL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-06, 13:26
jhartono jhartono is offline
Registered User
 
Join Date: Mar 2006
Posts: 1
DB2 Sequence Object PREVVAL

Hi,

I was just wondering if you guys have experience with SELECTING PREVVAL from a sequence object. It seems that evertime I start a new session and directly try to get the prevval from the sequence object it throws an exception saying that the sequence object has not been initialized.

Any suggestion on how to solve it?

J
Reply With Quote
  #2 (permalink)  
Old 03-03-06, 14:57
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Try reading the manual
Reply With Quote
  #3 (permalink)  
Old 03-07-06, 06:18
JAYANTA_DATTA JAYANTA_DATTA is offline
Registered User
 
Join Date: Oct 2004
Location: DELHI INDIA
Posts: 336
how you created the Sequence?

try the one: CREATE SEQUENCE seq_test1 AS INTEGER START WITH 1 INCREMENT BY 1

and then query for PREVVAL for seq_test1.
Reply With Quote
  #4 (permalink)  
Old 03-09-06, 16:07
arcillar arcillar is offline
Registered User
 
Join Date: Nov 2002
Posts: 14
You need to call NEXTVAL before PREVVAL.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On