create table TRANTYPE
(
tran_type number(10),
sub_tran_type number(5),
int_tran_type number(2),
tran_id number(5),
status char(1),
tran_name char(120) not null
)alter table TRANTYPE
add constraint TRANTYPE_PK
primary key(tran_id)运行后出现错误:
ORA-00922 缺少符号或无效的符号。分别运行这两句都没问题。这是什么原因呢? 

解决方案 »

  1.   

    create table TRANTYPE
    (
    tran_type number(10),
    sub_tran_type number(5),
    int_tran_type number(2),
    tran_id number(5),
    status char(1),
    tran_name char(120) not null
    );alter table TRANTYPE
    add constraint TRANTYPE_PK
    primary key(tran_id);
    就Ok了,拿分来!!!!!!!!!!!!!!!!!!!!!!!!!!!
      

  2.   

    还是不行……添加分号后出现:
    ORA-00911: invalid character(难道指的是分号?)我用的是 sybase toad
      

  3.   

    sybase toad ? 分号要用英文分号。我说的数据库是oracle。