what does enable means in create table?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: what does enable means in create table?

  1. #1
    Join Date
    Nov 2003
    Posts
    48

    what does enable means in create table?

    Create table "schema"."mytable"(tableid number not null enable)

    In the above sql statement, what does enable means?
    what is the effect on this?

    Thanks!

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    What do the docs say?
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Nov 2003
    Posts
    48
    I don't know...
    since I can just find Number not null without enable.
    Please advise

  4. #4
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Code:
    SQL> create table t1 (f1 number not null enable);
    
    Table created.
    
    SQL> create table t2 (f1 number not null disable);
    
    Table created.
    
    SQL> select table_name, constraint_name, constraint_type, status
      2  from user_constraints;
    
    TABLE_NAME                     CONSTRAINT_NAME                C STATUS
    ------------------------------ ------------------------------ - --------
    T1                             SYS_C001568                    C ENABLED
    T2                             SYS_C001569                    C DISABLED
    
    SQL> insert into t1 (f1) values (null);
    insert into t1 (f1) values (null)
    *
    ERROR at line 1:
    ORA-01400: cannot insert NULL into ("MARIST89"."T1"."F1")
    
    
    SQL> insert into t2 (f1) values (null);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  5. #5
    Join Date
    Nov 2003
    Posts
    48
    But default it is enable if I don't type Enable/Disable?

  6. #6
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Try it and let us know.
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

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