定义表的时候怎样把identify用来定义列

解决方案 »

  1.   

    双引号。
    create table aa("identify" varchar2(20));
      

  2.   


    right!把关键字,保留字作为对象名是非常不好的习惯
      

  3.   


    同意1,2 楼......
    ------------------------------------------------------------------------------
    Blog: http://blog.csdn.net/tianlesoftware
    网上资源: http://tianlesoftware.download.csdn.net
    相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
    Q Q 群:62697716 
      

  4.   

    我感觉楼主的意思是怎么正常地用identity吧?
      

  5.   

    先建一个序列:   
      create   sequence   order_ids   start   with   2   increment   by   1   nomaxvalue;   
      使用:   
      insert   into   items(id)   values(order_ids.nextval);   
      

  6.   

    oracle不能用identity,需要要序列+触发器代替create table GROUPMANAGE 

      GROUPID  NUMBER not null, 
      GROUPNAME VARCHAR2(100) not null, 
      GROUPDESC VARCHAR2(300) 
    ); create sequence SEQ_GROUPMANAGE_GROUPID 
    minvalue 1 
    maxvalue 999999999999999999999999999 
    start with 1 
    increment by 1 
    nocache; create or replace trigger CMD_GroupManage_GroupID_Trig 
      before insert 
      on groupmanage 
      for each row begin   select SEQ_GroupManage_GroupID.nextval into :new.Groupid from dual; end;
      

  7.   

    oracle不能用identity,需要要序列+触发器代替identity是sql中用来自增的!
      

  8.   

    SQL> create table t1(id number,name varchar2(20));Table created.
    SQL> create sequence tt;Sequence created.
    SQL> CREATE OR REPLACE TRIGGER TRI_TEST
      2  BEFORE INSERT ON t1
      3  FOR EACH ROW
      4  BEGIN
      5    SELECT tt.NEXTVAL INTO :NEW.id FROM dual;--这句的意思就是取出序列的下一个值把它赋值给新插入数据的id字段 因为在插入的时候你没有指定id字段的值 只指定name字段的值就可以了
      6  END;
      7  /Trigger created.SQL> insert into t1(name) values('one');1 row created.SQL> insert into t1(name) values('two');1 row created.SQL> select * from t1;        ID NAME
    ---------- --------------------
             1 one
             2 two
      

  9.   

    identify(1,1)这个是怎么用的??
      

  10.   

    identify(1,1) 这是sqlserver中的用法:
    如:create table t1(id int identify(1,1),[name] varchar(50))oracle中如楼上的几位说法:序列+触发器
    1)建表
    2)建序列
    3)建触发器 关联表和序列
    4)就可以插入数据了刚从sqlserver转oracle的时候,曾被oracle这种复杂的方法困扰过。