Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2003
    Posts
    22

    Unanswered: Auto generate Primary Key

    How would I go about instructing Oracle 8.1.5 to autogenerate the primary key (which is a numerical unique ID in my table) everytime I insert a tuple into that table? Please help. Thanks.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002

  3. #3
    Join Date
    Nov 2003
    Posts
    22
    What comes after "create sequence" ....?

  4. #4
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    After create sequence comes lots of complicated characters. They are quite involved, so google doesn't quite understand them.

    This is it's closest appromixamtion.....

    http://www.google.com/search?hl=en&l...reate+sequence

    But it's quite complicated and can be specific to your instance. This is why we ignore the oracle manuals (from www.oracle.com) and disregard anything that google can offer.

    Hth
    Bill

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Originally posted by VB_Oracle
    What comes after "create sequence" ....?
    the name of the sequence

    e.g. CREATE SEQUENCE foo INCREMENT BY 15

    check that link i gave you for how to pull NEXTVAL and use it in your INSERT statement


    rudy

  6. #6
    Join Date
    Nov 2003
    Location
    Bangalore, INDIA
    Posts
    333

    Thumbs up

    Hi,

    CREATE SEQUENCE <Sequence_Name>
    START WITH 1
    INCREMENT BY 1
    NOMAXVALUE
    NOCYCLE
    CACHE 20
    ORDER;


    Originally posted by VB_Oracle
    What comes after "create sequence" ....?
    SATHISH .

  7. #7
    Join Date
    Nov 2003
    Posts
    22
    Thanks!!!!

Posting Permissions

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