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 number

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-07-06, 07:46
meiwen meiwen is offline
Registered User
 
Join Date: Oct 2005
Posts: 30
serial number

I have a table with the field serial number as the primary key:
create table test (id serial primary key, name char(10))

There is procedures to insert into test(name) values('xx').
And meantime there is purge on test table with certain condition.

Now the id is retrieve to maximum value , so seems the next serial number will restart from 1, So it tries to insert with 1, with dupliated constraints error, then it goes next to 2, again error, repeat insert, till it reaches the first free serial number. Seems it is automatically find the gap for the free seiral numbers which are purged.

Could anybody tell me how to solve this problem?
Is there any configuration should be done on informix, or on the table,
in order to get the free serial number automatically?
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