Path: news.easynews.com!easynews!news-xfer.siscom.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn1feed!wn4feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc02.POSTED!not-for-mail
From: John Russell <netnews3@johnrussell.mailshell.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: Question about Sequences
Message-ID: <j50ufu04q5ofm07q5chd0k4cmn43tddaog@4ax.com>
References: <1efdad5b.0206050710.4af26dd4@posting.google.com>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 28
NNTP-Posting-Host: 12.232.220.154
X-Complaints-To: abuse@attbi.com
X-Trace: sccrnsc02 1023345158 12.232.220.154 (Thu, 06 Jun 2002 06:32:38 GMT)
NNTP-Posting-Date: Thu, 06 Jun 2002 06:32:38 GMT
Organization: AT&T Broadband
Date: Thu, 06 Jun 2002 06:32:38 GMT
Xref: easynews comp.databases.oracle.server:149698
X-Received-Date: Thu, 06 Jun 2002 01:01:25 MST (news.easynews.com)

On 5 Jun 2002 08:10:33 -0700, rgaffuri@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.
