1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

createing a table Using Alphanumeric sequence

Discussion in 'Oracle' started by askr, Jan 8, 2013.

  1. askr

    askr New Member

    Joined:
    Dec 22, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hello friends,

    I want to Create a Table with a Alpha Numeric Sequence,

    Is there any way to create sequence without using Triggers. If so please Help me..


    Thanks in Advance...


    regards

    askr
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    If you only have one process that writes to the table then you could do something like SELECT MAX() on a numeric column, add 1, then make that the identifier. That won't work with an alphanumeric sequence though. But if you have some way to determine the next valid sequence value then you can perform that operation before each insert.

    What are you trying to do?
    Why does the sequence need to be alphanumeric (as opposed to just numeric)?
     
    askr likes this.
  3. askr

    askr New Member

    Joined:
    Dec 22, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Sir, We are creating a database for training institute, so for every table we want to use unique Number with Alpha Numeric...as it is going to be easy for identifying.

    Example for Students Table : Std1
    Example for Batches Table : B105
     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    Why isn't a simple number enough? For example, SELECT ... WHERE BATCHES.ID=105; is clear enough. You shouldn't need to include an abbreviation of the table name within the table ID field.
     
    askr likes this.
  5. askr

    askr New Member

    Joined:
    Dec 22, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Ok..... Thanks allot Mate.
     

Share This Page