SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    maximum value of team_id(automatic generated) stuck at tm_999

    I have a piece of code in ASP which automatically generated as team_id as teams are added by users and stores team_id value in sql database. This code was working fine until team_ID value reached tm_999 after that this piece of code is allocating team_Id for every team added as tm_* instead of going to tm_1000. Can anybody tell what should i change in order to fix this problem?

    Code:
    '*********** This is code for sequence generation for Team id.
    dim cmd_Nextval
    set cmd_nextval = server.CreateObject ("ADODB.command")
    set p1 = server.CreateObject ("ADODB.Parameter")
    set p2 = server.CreateObject ("ADODB.Parameter")
    
    'Declare Costants
    const adCmdStoredProc = &H0004
    const adChar = 129
    const adParamInput = &H0001
    const adParamOutput = &H0002
    
    cmd_Nextval.ActiveConnection = objConn
    cmd_Nextval.CommandText = "NEXTVAL"
    cmd_Nextval.CommandType = adCmdStoredProc
    
    p1.name = "@seqname"
    p1.type = adChar
    p1.direction = adParamInput
    p1.size = 50
    p1.value = "TEAM"
    
    cmd_Nextval.Parameters.Append (p1)
    
    p2.name = "@pre"
    p2.type = adChar
    p2.direction = adParamOutput
    p2.size = 50
    
    cmd_Nextval.Parameters.Append (p2)
    
    dim teamt_id
    cmd_Nextval.execute
    team_id = p2.Value ' = cmd_Nextval.NamedParameters("pre")
    team_id = trim(team_id)
    
    
    
    '*******************
    Thanks in advance

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,254
    Mentioned
    113 Post(s)
    Tagged
    1 Thread(s)
    The problem is most likely residing in your NEXTVAL stored proc. Start there. If you don't see anything, please provide the stored proc and some sample data...
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  3. #3
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I wondered if it might be the data type definition for the ID field in the database, but even SMALLINT allows up to 32767.
    Ian Anderson
    www.siteguru.co.uk


Bookmarks

Posting Permissions

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