两种创建主键的方法:
     1.创建主键时,给主键添加名称
     alter table t1 add constraint pk_name primary key (id1) using index tablespace impidx;
     2.创建主键时,不给主键添加名称
     alter table t1 add primary key (id1) using index tablespace impidx;    在第二种情况下,系统会给其默认添加一个主键名称,如:SYS_C0057624
    请高手指点下:SYS_C0057624 该怎样理解?
       下次按此方法添加主键或其他类型的键时,此值会依次增长。如:SYS_C0057625、SYS_C0057626、SYS_C0057627
       

解决方案 »

  1.   

    也许你是对的。SQL> create table t001 (id number);Table created.SQL> alter table t001 add primary key (id) ;Table altered.select constraint_name from user_constraints where table_name='T001'CONSTRAINT_NAME
    ------------------------------
    SYS_C0016152SQL> create table t002 (id number, name varchar2(20));Table created.SQL> alter table t002 add primary key (id);Table altered.SQL> select constraint_name from user_constraints where table_name='T002';CONSTRAINT_NAME
    ------------------------------
    SYS_C0016153