PLSQL同时执行多条语句实例
/*建表*/
/*创建表TBSLSWDICTTHEMETYPE*/
/*创建表TBSLSWDICTTHEMETYPE*/
-- Create table
create table TBSLSWDICTTHEMETYPE
(
themetypeguid VARCHAR2(50) not null,
themetypename VARCHAR2(200) not null,
themetypecode VARCHAR2(100) not null,
parentguid VARCHAR2(50),
themelevel NUMBER(4) not null,
showorderid NUMBER(4) not null,
isused NUMBER(4) not null,
remark NVARCHAR2(2000)
)
tablespace SZSLSYS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64
next 8
minextents 1
maxextents unlimited
)
nologging;
-- Add comments to the columns
comment on column TBSLSWDICTTHEMETYPE.themetypeguid
is 'GUID';
comment on column TBSLSWDICTTHEMETYPE.themetypename
is '专题类型名称,不能重复,例如:河湖基本情况';
comment on column TBSLSWDICTTHEMETYPE.themetypecode
is '用户程序编码,编号规则:SL+“专题名称拼音首字母”例如:SLHH,表示“河湖基本情况”,专题类型代码不能重复';
comment on column TBSLSWDICTTHEMETYPE.parentguid
is '父级专题GUID,为空表示最顶层';
comment on column TBSLSWDICTTHEMETYPE.themelevel
is '当前处于哪个等级';
comment on column TBSLSWDICTTHEMETYPE.showorderid
is '流水号,用来调整专题数据列表时的显示顺序';
comment on column TBSLSWDICTTHEMETYPE.isused
is '是否启用:
0:未启用
1:已启用
';
-- Create/Recreate primary, unique and foreign key constraints
alter table TBSLSWDICTTHEMETYPE
add constraint PK_THEMETYPEGUID primary key (THEMETYPEGUID)
using index
tablespace SZSLSYS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
alter table TBSLSWDICTTHEMETYPE
add constraint U_THEMETYPECODE unique (THEMETYPECODE)
using index
tablespace SZSLSYS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
alter table TBSLSWDICTTHEMETYPE
add constraint U_THEMETYPENAME unique (THEMETYPENAME)
using index
tablespace SZSLSYS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
alter table TBSLSWDICTTHEMETYPE
add constraint FK_THEMETYPEGUID_THEMETYPEGUID foreign key (PARENTGUID)
references TBSLSWDICTTHEMETYPE (THEMETYPEGUID);
/*创建表TBSLSWDATAIMPORTLOG*/
-- Create table
create table TBSLSWDATAIMPORTLOG
(
logguid VARCHAR2(50) not null,
themetypeguid VARCHAR2(50) not null,
processstate NUMBER(4) not null,
logcontent NVARCHAR2(2000) not null,
submitdepartment NVARCHAR2(100),
submittime DATE,
sourcefilename VARCHAR2(100) not null,
sourcedataformat NUMBER(4) not null,
reccount NUMBER(4) not null,
datarange VARCHAR2(100),
tempdsname VARCHAR2(40) not null,
tempfcname VARCHAR2(40) not null,
intemplibtime DATE,
currdsname VARCHAR2(40) not null,
currfcname VARCHAR2(40) not null,
intemplibmodel NUMBER(2) not null,
incurrlibmodel NUMBER(2) not null,
incurrlibtime DATE
)
tablespace SZSLSYS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64
next 1
minextents 1
maxextents unlimited
)
nologging;
-- Add comments to the columns
comment on column TBSLSWDATAIMPORTLOG.logguid
is 'GUID';
comment on column TBSLSWDATAIMPORTLOG.themetypeguid
is '要入库的水利水务专题数据类型编号,字段值来源水利水务专题数据字典表中的专题类型编号字段';
comment on column TBSLSWDATAIMPORTLOG.processstate
is '0:上传失败
1:上传成功
2:审核通过
3:审核未通过
4:检查失败
5:检查成功
6:入临时库失败
7:入临时库成功
8:入现势库失败
9:入现势库成功
';
comment on column TBSLSWDATAIMPORTLOG.logcontent
is '处理日志描述,XML格式,包括“编号、时间、事件、处理人、处理情况、结果”等数据项';
comment on column TBSLSWDATAIMPORTLOG.submitdepartment
is '数据提交单位名称,对于公共服务平台上传的,可以是上易做图位名称;';
comment on column TBSLSWDATAIMPORTLOG.submittime
is '格式:yyyy-mm-dd hh:mm';
comment on column TBSLSWDATAIMPORTLOG.sourcefilename
is '只记录文件名,不必带路径';
comment on column TBSLSWDATAIMPORTLOG.sourcedataformat
is '0:Shapefile
1:AutoCad
2:Personal Geodatabase
3:File Geodatabase
4:Mdb中间库
';
comment on column TBSLSWDATAIMPORTLOG.reccount
is '源数据记录数';
comment on column TBSLSWDATAIMPORTLOG.datarange
is '数据范围顶点坐标,格式:(顶点1X坐标,顶点1Y坐标),(顶点2X坐标,顶点2Y坐标),(顶点3X坐标,顶点3Y坐标)';
comment on column TBSLSWDATAIMPORTLOG.tempdsname
is '临时库SDE DataSet名称';
comment on column TBSLSWDATAIMPORTLOG.tempfcname
is '临时库SDE Featureclass名称';
comment on column TBSLSWDATAIMPORTLOG.intemplibtime
is '格式:yyyy-mm-dd hh:mm,记录最后一次数据处理时间';
comment on column TBSLSWDATAIMPORTLOG.currdsname
is '现势库SDE DataSet名称';
comment on column TBSLSWDATAIMPORTLOG.currfcname
is '现势库SDE Featureclass名称';
comment on column TBS