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

Home -> Community -> Usenet -> c.d.o.server -> Re: Autonumbering

Re: Autonumbering

From: Lothar Armbrüster <lothar.armbruester_at_rheingau.netsurf.de>
Date: 27 Jul 99 22:02:40 +0100
Message-ID: <1354.877T2040T13224151lothar.armbruester@rheingau.netsurf.de>


kev wrote on 26-Jul-99 17:26:03:
>Kingsley Sawyers wrote:

>> Create the SQL command you want and execute it when the database
>> (instance) is running. This creates the Sequence object, for
>> evermore.

>What if I have to move the database to another server, or create it
>again from scratch for some reason? I intend to have a database
>creation script for this very reason. Would it be wise to put the
>sequence declaration statement in here, or is there some other
>initialisation file for this purpose?

I think it's not very clever to put the sequence creation into such a script, unless you won't move the data to the new server. The reason is that a sequence is something like a counter which increases everytime you access it. It is not associated to any table. So if you recreate it in some database creation script, you have to set the start value to the maximum id number of your table plus one. There comes the problem the your database creation script does not know this number. Normally you would export the sequence along with your data am import it on the new server. This way your sequence keeps it current value.

>Ta,

>- Kev

Hpoe that helps,
Lothar

--
Neue Adresse ab 10.07.'99:

Lothar Armbrüster       | lothar.armbruester_at_rheingau.netsurf.de
Hauptstr. 26            | lothar.armbruester_at_t-online.de
D-65346 Eltville        |

Received on Tue Jul 27 1999 - 16:02:40 CDT

Original text of this message

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