1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

how to attach sequence to a column in a table

Discussion in 'Oracle Apps Technical' started by venky359, Apr 23, 2010.

  1. venky359

    venky359 Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Hi frnds..
    I have a table for Key flex field which has column CCID of not null type..and i want to generate number to CCID automatically.
    and i had created sequence using the following code

    CREATE SEQUENCE SEQ1
    START WITH 1
    INCREMENT BY 1

    how can i attach this sequence to my column CCID....please tell me

    Thanks in Advance
     
  2. apps_expert

    apps_expert Forum Expert

    Messages:
    325
    Likes Received:
    28
    Trophy Points:
    330
    Location:
    Chennai, India
    You cannot automatically fill in your column with sequence values. If you are inserting into this table from some code somewhere then use the seq1.nextval in the insert statement.

    If not, you should try implementing this with Triggers. Read this resource: http://www.oracle-base.com/articles/misc/AutoNumber.php