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: sequences

Re: sequences

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Tue, 12 Mar 2002 14:48:20 GMT
Message-ID: <Uyoj8.22950$702.12133@sccrnsc02>


It gets the current sequence number for your session for a specific sequence.

You can go to the data dictionary if you want it for all sessions.  get the names and cycle through to get all the current values - a stored procedure would be effective for this.

 and you could select max( ) from the data dictionary if you want the highest for all sessions (that have been written to disk)

select max(last_number ) from dba_sequences.

A sequence does not have to be tied to a table. You could use a sequence for a parent and its children.

What value is the highest sequence number for a session accross ALL sequence numbers?

Jim

"Andre Grosse" <ag17_at_inf.tu-dresden.de> wrote in message news:3C8DEA68.2030707_at_inf.tu-dresden.de...
> imho thats by far not the answer.
>
> i look for the last generated sequence number in the whole session, not
> for a special table in all sessions.
>
> this solution pays attention to session context?
> if 2 parallel jdbc connections write...you see?
>
> --
> Andre Grosse
>
>
> Niall Litchfield wrote:
> > select mysequence.currval from dual;
> >
> >
> > --
> > Niall Litchfield
> > Oracle DBA
> > Audit Commission UK
> > *****************************************
> > Please include version and platform
> > and SQL where applicable
> > It makes life easier and increases the
> > likelihood of a good answer
> >
> > ******************************************
> > "Andre Grosse" <ag17_at_inf.tu-dresden.de> wrote in message
> > news:3C8DE6A3.1030309_at_inf.tu-dresden.de...
> >
> >>under MS-SQL 'SELECT @@IDENTITY' delivers the last generated autoindex
> >>value of any table in the current session.
> >>i know, how to emulate MSSQL-like autoindices with sequences und
> >>before-insert triggers, but how could i emulate this 'SELECT
> >>@@IDENTITY', i.e. with something similar like 'SELECT ???IDENTITY???
> >>FROM DUAL'?
> >>i have some problems with the session context. any ideas?
> >>
>
Received on Tue Mar 12 2002 - 08:48:20 CST

Original text of this message

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