DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: DEFAULT CONSTRAINT

  1. #1
    Join Date
    Jan 2002
    Posts
    146
    Hi Friends,

    Can I use default contriant to assign sequence no. to
    a column?

    e.g.

    CREATE TABLE EMP
    (IDNO NUMBER DEFAULT SEQ1.NEXTVAL,
    HIREDATE DATE DEFAULT SYSDATE,
    NAME VARCHAR2(30) NOT NULL)
    /

    I got error in line #2.... but #3 works.

    SOS please.

  2. #2
    Join Date
    Jan 2002
    Posts
    146
    well, I can select both using DUAL....

    SQL> SELECT SYSDATE FROM DUAL;

    SYSDATE
    ---------
    04-JUL-02

    SQL> SELECT SEQ1.NEXTVAL FROM DUAL;

    NEXTVAL
    ----------
    1


  3. #3
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    No, sequence can not be referenced for default value for the column.

    Sanjay

Posting Permissions

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


Click Here to Expand Forum to Full Width