建立表的时候加上约束就行了,如:()
create table <table_name> 
  CNAME varchar2(2)   
      check (CNAME      in ('Y','N')) not null DEFAULT 'N',

解决方案 »

  1.   

    你可以像这样啊:sql>  create table <CheckOneValue_table> 
         field_1 varchar2(2)   
          check (field_1      in ('Y','N')) not null DEFAULT 'N',/
    sql>执行成功
      

  2.   

    check (CNAME      in ('Y','N')) not null DEFAULT 'N'
      

  3.   

    create table table_name(  CNAME varchar2(2)....)       check (CNAME  in ('Y','N')) not null DEFAULT 'N';
    或者用OEM设定。
      

  4.   

    check (CNAME in ('Y','N')) DEFAULT 'N' not null;   --决省值在not null这前
      

  5.   

    check (CNAME in ('Y','N')) DEFAULT 'N' not null;
    --------------------------------------------------
    -- Good !