这个表建不出来 不知道哪里错了
我给每一个字段加了双引号 还是不行 是其他地方写的有问题
1.表名不用加单引号
2.date类型不用直接写date就好,不用写date(0)
先这么改下吧,其余我再看看
3.id作为patmary key 直接放在id字段那一行,not null也删了,然后把你自己写的表里右括号前设置主健那段删了
4.unsigned去了,set utf8那个全不要
5.把null default null 删了
6.create tbale 括号外的内容不要,也删了。
7.创个表不用搞那么复杂,最核心的主外键、字段名以及长度,最多还有个comment可以加,约束可以不用的话不用搞那么多,你这搞太复杂了。
按这个格式修改
-- Create table
create table DEMO
(
ID number(20) not null,
TABLE_ID number(20) not null,
COLUMN_NAME varchar2(200),
COLUMN_COMMENT varchar2(500)
)
;
-- Add comments to the table
comment on table DEMO
is '例子';
-- Add comments to the columns
comment on column DEMO.ID
is '主键ID';
comment on column DEMO.TABLE_ID
is '归属表ID';
comment on column DEMO.COLUMN_NAME
is '列名称';
comment on column DEMO.COLUMN_COMMENT
is '列描述';
-- Create/Recreate primary, unique and foreign key constraints
alter table DEMO
add constraint PK_DEMO_ID primary key (ID);
这种是不是可以直接访问oracle官网上的oracle数据库文档,看文档会更准确一点
oracle 的id自增需要建序列;
oracle 类型没有varchar2;