如何用语句创建oralce表,并给表名和字段名写入备注名(200分)

  • 主题发起人 主题发起人 aahben
  • 开始时间 开始时间
A

aahben

Unregistered / Unconfirmed
GUEST, unregistred user!
我要用sql语句创建一个oracle表,同时给表名和字段名加上备注,不知道该如何做,
'create table gay (address varchar2(255) default '''' NOT NULL,name varchar2(64) default NULL); comment on table gay is ''港澳游''; comment on column gay.address is ''地址''; comment on column gay.name is ''name''',
运行时报语句未结束,将此语句放到oracle的sql navigator中将首尾的引号去掉却可以执行,请大家指点.
 
沙发...顶一个...只用过MSSQL
 
看一下下面这个例子就会啦,
create table CRM_CERT_APPLY_HEADER (
APPLY_ID integer not null,
APPLY_NO varchar2(32),
APPLY_TIME date,
APPLY_QTY integer,
STAT integer,
APPLY_MAN varchar2(32),
ADDR varchar2(128),
TEL varchar2(32),
POST_CODE varchar2(32),
RESIDUAL_QTY integer,
ORG_ID integer,
ORG_CODE varchar2(32),
ORG_NAME varchar2(128),
IDPATH varchar2(255),
CREATOR varchar2(32),
CREATE_TIME date,
UPDATOR varchar2(32),
UPDATE_TIME date,
CHECKOR varchar2(32),
CHECK_TIME date,
NOTE varchar2(255),
IS_CLOSED integer,
CHECK_QTY integer,
SEND_QTY integer,
constraint PK_CRM_CERT_APPLY_HEADER primary key (APPLY_ID)
)
/
comment on column CRM_CERT_APPLY_HEADER.APPLY_ID is
'申请单ID'
/
comment on column CRM_CERT_APPLY_HEADER.APPLY_NO is
'申请单号'
/
comment on column CRM_CERT_APPLY_HEADER.APPLY_TIME is
'申请日期'
/
comment on column CRM_CERT_APPLY_HEADER.APPLY_QTY is
'申请数量'
/
comment on column CRM_CERT_APPLY_HEADER.STAT is
'状态'
/
comment on column CRM_CERT_APPLY_HEADER.APPLY_MAN is
'申请联系人 '
/
comment on column CRM_CERT_APPLY_HEADER.ADDR is
'邮寄地址'
/
comment on column CRM_CERT_APPLY_HEADER.TEL is
'联系电话'
/
comment on column CRM_CERT_APPLY_HEADER.POST_CODE is
'邮政编码'
/
comment on column CRM_CERT_APPLY_HEADER.RESIDUAL_QTY is
'剩余合格证数量'
/
comment on column CRM_CERT_APPLY_HEADER.ORG_ID is
'申请单位id'
/
comment on column CRM_CERT_APPLY_HEADER.ORG_CODE is
'申请单位编码'
/
comment on column CRM_CERT_APPLY_HEADER.ORG_NAME is
'申请单位名称'
/
comment on column CRM_CERT_APPLY_HEADER.IDPATH is
'IDPATH'
/
comment on column CRM_CERT_APPLY_HEADER.CREATOR is
'制单人'
/
comment on column CRM_CERT_APPLY_HEADER.CREATE_TIME is
'制单时间'
/
comment on column CRM_CERT_APPLY_HEADER.UPDATOR is
'修改人'
/
comment on column CRM_CERT_APPLY_HEADER.UPDATE_TIME is
'修改时间'
/
comment on column CRM_CERT_APPLY_HEADER.CHECKOR is
'审核人'
/
comment on column CRM_CERT_APPLY_HEADER.CHECK_TIME is
'审核时间'
/
comment on column CRM_CERT_APPLY_HEADER.NOTE is
'备注'
/
comment on column CRM_CERT_APPLY_HEADER.IS_CLOSED is
'1,否,2 是'
/
comment on column CRM_CERT_APPLY_HEADER.CHECK_QTY is
'审核数量'
/
comment on column CRM_CERT_APPLY_HEADER.SEND_QTY is
'已发放数量'
/
 
-- Create table
create table CONTRACT_FLOW_CONTROL
(
CODE_CONTRACT INTEGER,
W_DOWN VARCHAR2(30),
WD_TIME DATE,
F_TRIAL VARCHAR2(30),
FT_TIME DATE,
F_JUDGMENT VARCHAR2(30),
FJ_TIME DATE,
OPERATE VARCHAR2(20),
STATE INTEGER default 0,
REMARK VARCHAR2(100),
CODE_CONTRACTCLI INTEGER
)
tablespace BACK
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Add comments to the table
comment on table CONTRACT_FLOW_CONTROL
is '合同流程控制表';
-- Add comments to the columns
comment on column CONTRACT_FLOW_CONTROL.CODE_CONTRACT
is '商户合同ID';
comment on column CONTRACT_FLOW_CONTROL.W_DOWN
is '录入者';
comment on column CONTRACT_FLOW_CONTROL.WD_TIME
is '录入时间';
comment on column CONTRACT_FLOW_CONTROL.F_TRIAL
is '初审者';
comment on column CONTRACT_FLOW_CONTROL.FT_TIME
is '初审时间';
comment on column CONTRACT_FLOW_CONTROL.F_JUDGMENT
is '终审者';
comment on column CONTRACT_FLOW_CONTROL.FJ_TIME
is '终审时间';
comment on column CONTRACT_FLOW_CONTROL.OPERATE
is '操作';
comment on column CONTRACT_FLOW_CONTROL.STATE
is '标志(0:录入 1:终审 2:已送初审 3:已送终审)';
comment on column CONTRACT_FLOW_CONTROL.REMARK
is '备注';
comment on column CONTRACT_FLOW_CONTROL.CODE_CONTRACTCLI
is '客户合同ID';
 
搞定了,谢谢大家,语句要先创建表,再添加备注.散分了
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
844
DelphiTeacher的专栏
D
后退
顶部