Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264

    Question Unanswered: auto number field

    Does oracle have a datatype that is similar to the autonumber field in MS access? I want to create a unique numerical ID for a table that I am creating.

    Any thoughts on the best way to do this?

    Steve

    Steve

  2. #2
    Join Date
    Jan 2004
    Posts
    492
    Use a sequence - Oracle's autonumber.
    Last edited by ss659; 10-22-04 at 15:07.
    Oracle OCPI (Certified Practicing Idiot)

  3. #3
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    No Oracle does not have an autonumber datatype ...
    Use Sequences instead ...

    ex:
    create sequence yoursequencename
    start with 100 increment by 1;

    create table test (t1 number);

    insert into test select yoursequencename.nextval from dual;

    HTH
    Gregg

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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