Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Location
    Munich, Germany
    Posts
    35

    Unanswered: enabling auto numbering on existing columns

    Hi everyone,

    I have an Oracle table with some data. I want to edit a column in the table to start using auto numbering. I cannot figure out the SQL syntax to do so. I know there is an IDENTITY command in SQL Server, what is the equivalant in Oracle?

    Thanks,

    Pankaj

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    There is no equivalent in Oracle. Set up a sequence and call the sequence on insert ... or in a BEFORE INSERT trigger ...

    ie;
    select sequencenameisetup.nextval from dual;

    insert into tablename select
    sequencenameisetup.nextval,
    'columnname1',
    'columnname2'
    from dual;

    HTH
    Gregg

Posting Permissions

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