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 > Informix > serial value

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-23-11, 11:45
divak divak is offline
Registered User
 
Join Date: May 2008
Posts: 24
serial value

Hi,
I've a table with first column declared as serial type. In my INSERT statement, im using 0 to insert value to this field.

The problem is when i delete the records from this table and when i do insert from the scratch, this serial value is not getting reintitated to 1 whereas it is continuing from the last insert statement value.

Please can anyone let me know how to set this to start from 1.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 05-23-11, 14:15
marymurny marymurny is offline
Registered User
 
Join Date: Sep 2004
Posts: 32
serial value

You need to run an alter table:

The following example sets the next serial value to 1000:

ALTER TABLE my_table MODIFY (serial_num serial (1000))

I hope this helps.
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