Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

increment the primary key value without using sequences



Hi all,
 
I would like to know if its possible to increment the primary key field value of stocks table without using sequences by getting the next value of the pk field from the sequnce table ?
 
insert into stocks (prim_id, date,time, code, price, volume) (select ..... from temp_stocks)
 
sequence
sequence_code | next_value
prim_id               101
 
stocks table (prim_id, date, time, code, price, volume)
 
temp_stocks table (date, time, code, price, volume)
 
If it can be done, can you please explain me with an example.
 
Thanks a lot in advance.


Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when.

Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group