Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Auto sequencing

Auto sequencing

From: Shaun Mark Moss <smoss_at_intuitionweb.com>
Date: 2000/04/18
Message-ID: <8dht1o$umo$1@kermit.esat.net>#1/1

Hi
I am writing a C++ application that copies data from an old database and inserts it into a new Oracle database. Let's say I am transferring a User table which has a unique identifier called UserID.

I am wondering how Oracle 7/8 handles the autosequencing for UserID in this case. I want to preserve and copy the UserID from the old DB because there are other tables that link to the User table via this ID.

Must I turn Autosequencing off on the new User table, so that I can insert the UserID as a primary key? And if so, how? Once I have inserted the rows from the old table into the new one, I then need to be able to insert new users as normal, with the primary key (UserID) being generated automatically. Will it start from 1, or is there a way that I can tell it to start from max(UserID)+1?

Help is appreciated.
Shaun Received on Tue Apr 18 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US