SQL> create table t(id number ,name char(4));
Table created.
SQL> insert into t values(1,'yxy');
1 row created.
SQL> commit;
Commit complete.
SQL> alter table t add check (id=0 or id=1) enable;
Table altered.
SQL> select owner,constraint_name,constraint_type,last_change,SEARCH_CONDITION from dba_constraints where table_name='T';
OWNER CONSTRAINT_NAME C LAST_CHANGE SEARCH_CONDITION
---------- ------------------------------ - -------------- --------------------------------------------------
YXYUP SYS_C0013294 C 20071217184452 id=0 or id=1
Export: Release 10.2.0.3.0 - Production on Mon Dec 17 18:45:17 2007
Copyright (c) 1982, 2005,
Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table T 1 rows exported
Export terminated successfully without warnings.
Import: Release 10.2.0.3.0 - Production on Mon Dec 17 18:45:23 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing YXYUP's objects into YXYUP
. importing YXYUP's objects into YXYUP
Import terminated successfully without warnings.
SQL> r
1* select owner,constraint_name,constraint_type,last_change,SEARCH_CONDITION from dba_constraints where table_name='T'
OWNER CONSTRAINT_NAME C LAST_CHANGE SEARCH_CONDITION
---------- ------------------------------ - -------------- --------------------------------------------------
YXYUP SYS_C0013295 C 20071217184523 id=0 or id=1
YXYUP SYS_C0013294 C 20071217184452 id=0 or id=1
---我晕
SQL>drop table t cascade constraints purge;
Table dropped.
SQL> create table t(id number constraint id_c check (id=0 or id=1) , name char(4));
Table created.
SQL> insert into t values(1,'yxy');
1 row created.
SQL> commit;
Commit complete.
SQL> select owner,constraint_name,constraint_type,last_change,SEARCH_CONDITION from dba_constraints where table_name='T';
OWNER CONSTRAINT_NAME C LAST_CHANGE SEARCH_CONDITION
---------- ------------------------------ - -------------- --------------------------------------------------
YXYUP ID_C C 20071217183919 id=0 or id=1
Export: Release 10.2.0.3.0 - Production on Mon Dec 17 18:45:17 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table T 1 rows exported
Export terminated successfully without warnings.
Import: Release 10.2.0.3.0 - Production on Mon Dec 17 18:45:23 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing YXYUP's objects into YXYUP
. importing YXYUP's objects into YXYUP
Import terminated successfully without warnings.
SQL> r
1* select owner,constraint_name,constraint_type,last_change,SEARCH_CONDITION from dba_constraints where table_name='T'
OWNER CONSTRAINT_NAME C LAST_CHANGE SEARCH_CONDITION
---------- ------------------------------ - -------------- --------------------------------------------------
YXYUP ID_C C 20071217183919 id=0 or id=1
SQL> r
1* select owner,constraint_name,constraint_type,last_change,SEARCH_CONDITION from dba_constraints where table_name='T'
OWNER CONSTRAINT_NAME C LAST_CHANGE SEARCH_CONDITION
---------- ------------------------------ - -------------- --------------------------------------------------
YXYUP ID_C C 20071217183919 id=0 or id=1