Xref: alice comp.databases.oracle.tools:18010
Path: alice!news-feed.fnsi.net!news.idt.net!howland.erols.net!cpk-news-hub1.bbnplanet.com!news.news.gtei.net!Supernews60!supernews.com!news.he.net!news.mhpcc.edu!news.hpu.edu
Newsgroups: comp.databases.oracle.tools
Date: Thu, 29 Oct 1998 12:27:33 -1000
Message-ID: <F42CB9DBDC42D211B39F00AA00AF328201B67C77@Keiki.Hpu.Edu>
From: "Gene Plagge" <gplagge@hotmail.com>
References: <7176an$5kg@eng-ser1.erg.cuhk.edu.hk>
Subject: Re: problem about Sequence
Lines: 40
Organization: WorldxChange, Inc.
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4

Hi, Ken,

If what you want to know is what the last value the sequence generated, then
use:
select last_number from user_sequence;

But remember, the maximum value for the table may be less than the
last_number value, since a number generated by a sequence can be 'discarded'
if the update or insert into your table was not committed.

Hope this helps.

Gene Plagge
WorldxChange, Inc.
gplagge@hotmail.com


Ken Ho Kwok Fai wrote in message <7176an$5kg@eng-ser1.erg.cuhk.edu.hk>...
>        I made a sequence in a table "test" by the following SQL:
>
>============================================================
>create table registration
>  (user_id number NOT NULL primary key,
>   user_name varchar2(11)
>  );
>
>create sequence user_id_seq start with 1 increment by 1 nocycle;
>=============================================================
>
>        After I insert some values to the table, how could I know the
>max sequence number? Is there a table to store the sequence? I don't want
>to select it from the table and the compare the largest number as it
>needs a lot of time. Any method that could allow me to get the max
>sequence number? Thanks a lot.
>
>--
>Regards,
>Ken Ho


