Sequence Problems

Results 1 to 2 of 2

Thread: Sequence Problems

  1. #1
    Trish Guest

    Default Sequence Problems

    I have created a sequence in Oracle called ASSETID, AssetID is also the column that I want to increment.<BR><BR>create sequence ASSETID<BR>START WITH 1<BR>INCREMENT BY 1;<BR><BR>This is the ASP code that I use <BR> strSQL = "SELECT AssetID.nextval as id From Dual" <BR> Set RecordSetObjectSeq = Server.CreateObject("ADODB.RecordSet")<BR> RecordSetObjectSeq.Open strSQL, objConn, 2, 3, adCmdText<BR> sequence = RecordSetObjectSeq("id") <BR><BR>for some reason it is being incremented by two so the IDs are being set as 2 , 4 , 6 etc,<BR><BR>any ideas??<BR><BR>Trish

  2. #2
    Join Date
    Dec 1969

    Default RE: Sequence Problems

    first up you dont need to use "AS" to specify the sequence name and second, I have faced the same problem so many times but couldnt find out why, how about picking up the currval from dual everytime and then add 1 to it for each record, just a thought.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts