Re: How to simulate sequence numbers of Oracle
Posted in 1996
Topics: Connectivity: ODBC / JDBC / .NET
femski@netcom.com (Sanjay Kumar) wrote: > > > Hi Folks ! > > I am trying to port a large ORACLE application to some of the other RDBMS > systems using ODBC as API. One of the things I need to deal with is > handling sequences. Oracle sequence number generator is an excelent > facility, unfortunately not supported by other systems (to my knowledge). > > How do you simulate sequences in any other system using SQL-92 only ? > You are allowed to create a dummy table for each sequence. I guess I need > to atomically increment the sequence, and select its value too. > I need to be able to handle issues related to rollbacks and concurrency > control. > > Where can I find refernces in literature to the sequence number generation > problem ? > > Thanks very much for your help. > > -Sanjay Kumar > Jacobus technology, Inc. > E-mail: skumar@jacobus.com > > > > Hello Sanjay, If you have the Sybase manuals, read up on the "Identity" column feature. This will automatically assign a sequential number to every inserted row. If you bring keys over from Oracle and need to maintain their values you will also need to read up on the "set identity_insert off" command. This allows one to insert rows into a table that has an identity column while specifying the value of the identity column (normaly one does not as it is calculated and assigned by Sybase). All of this can be found in either the Administrator's Guige or the SQL Reference Hope this helps. Regards, Stefan Mahs, Sanlam (South Africa)