if exists table drop table ORACLE 存储过程

2017-01-05 11:08:57来源:oschina作者:卯金刀GG人点击

CREATE OR REPLACE PROCEDURE DROPEXITSTABS (TAB_NAME_IN IN varchar2) IS v_cnt Number;begin select count(*) into v_cnt from user_tables where table_name = upper(TAB_NAME_IN);if v_cnt>0 then execute immediate 'drop table ' || TAB_NAME_IN ||' purge';end If;end DROPEXITSTABS;


call DROPEXITSTABS('ZYWSPT-ZYWSSJJ');


create table "ZYWSPT-ZYWSSJJ" (ID NUMBER(20) not null,ZBDM NVARCHAR2(20) null,NBBSF NVARCHAR2(30) null,SJYBSF NVARCHAR2(30) null,SJYMC NVARCHAR2(50) null,DY NVARCHAR2(200) null,SJLX NVARCHAR2(10) null,BSGS NVARCHAR2(10) null,YXZ NVARCHAR2(200) null,BZ NVARCHAR2(200) null,DLZ NVARCHAR2(20) null,DLSJ TIMESTAMP null,GXZ NVARCHAR2(20) null,GXSJ TIMESTAMP null,constraint "PK_ZYWSPT-ZYWSSJJ" primary key (ID) );

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台