[comp.databases] Sequencing records in Oracle

lwk@caen.engin.umich.edu (Woody Kellum) (08/04/90)

I have an application in Oracle that requires records to have a sequence 
number associated them. I want to be able to insert new records and move
old records around within the sequence, and then re-number the records
periodically, keeping the same order, so that the sequence numbers don't
get to hairy. I want something like:

UPDATE ORDERD_TABLE SET ORDERNO = MY_$SEQ.NEXTVAL ORDER BY ORDERNO;

The above is not a valid Oracle sql statement. There must be a way to do
this, but I haven't thought of it yet. Any ideas?

Woody Kellum (lwk@caen.engin.umich.edu)
--
Woody Kellum   Internet:  lwk@caen.engin.umich.edu
                          

lwk@caen.engin.umich.edu (Woody Kellum) (08/04/90)

I have an application in Oracle that requires records to have a sequence 
number associated them. I want to be able to insert new records and move
old records around within the sequence, and then re-number the records
periodically, keeping the same order, so that the sequence numbers don't
get to hairy. I want something like:

UPDATE ORDERD_TABLE SET ORDERNO = MY_$SEQ.NEXTVAL ORDER BY ORDERNO;

The above is not a valid Oracle sql statement. There must be a way to do
this, but I haven't thought of it yet. Any ideas?

Woody Kellum (lwk@caen.engin.umich.edu)


--
Woody Kellum   Internet:  lwk@caen.engin.umich.edu