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: Question about Sequences

Re: Question about Sequences

From: John Russell <netnews3_at_johnrussell.mailshell.com>
Date: Thu, 06 Jun 2002 06:32:38 GMT
Message-ID: <j50ufu04q5ofm07q5chd0k4cmn43tddaog@4ax.com>


On 5 Jun 2002 08:10:33 -0700, rgaffuri_at_cox.net (Ryan Gaffuri) wrote:

>Someone on my project recently truncated all the tables in one of our
>databases and imported new data. The problem is that the our sequence
>generators did not reset to match the highest sequence we have in our
>primary keys, so we keep hitting a unique constraint.
>
>Is there a command to reset sequences to the highest value in the
>table?
>Id prefer to run this dynamically than have to find the highest value
>for each sequence add set it to n + 1. This would be time consuming.
>
>Thanks.

In SQL*Loader, you can specify the SEQUENCE keyword, and one of the options is to find the biggest value in the column and continue with larger values.

http://tahiti.oracle.com/pls/db92/db92.drilldown?remark=docindex&word=sequence&book=a96652&preference=&verb=setting

John

--
Got an Oracle database question?
Try the search engine for the database docs at:
http://tahiti.oracle.com/

The opinions expressed above are mine and do not
necessarily reflect those of Oracle Corporation.
Received on Thu Jun 06 2002 - 01:32:38 CDT

Original text of this message

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