The simplest way I have found to find the last sequence number and determine the next sequence number is:
 
<cfquery name="myQuery">
    SELECT    MAX(SEQNUMBER) AS MAXSEQNUMBER
    FROM        MY TABLE
</cfquery>
 
<cfset NewSequenceNumber = #myQuery.MAXSEQNUMBER# + 1>
 


Gary L. Alford
Manufacturing Operations Project Specialist
Bell Helicopter XWorx
Phone: (817) 280-6233     Fax: (817) 278-6233
[EMAIL PROTECTED]

I have not failed.  I've found 10,000 ways that won't work.
          Thomas A. Edison

-----Original Message-----
From: Schreck, Tom [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 9:59 AM
To: [email protected]
Subject: OT: ORACLE Sequence

Is there a way to query what the next sequence number will be?  In SQL Server, you can use @@Identity to retrieve the newly inserted record's identity value.  In ORACLE, they use sequences.  I need to know the value of the sequence so I can return it after inserting a record.

 

 

Thanks

 

Tom Schreck

Applications Developer

Dresser, Inc.

15455 Dallas Parkway, Suite 1100

Addison, TX  75001-4690

972-361-9943

[EMAIL PROTECTED]

 

 

 

 

<<attachment: image001.jpg>>

Reply via email to