ストアド・プロシージャ構造テーブルによるテーブルの生成
17211 ワード
CREATE TABLE JGTB5001( ZDM VARCHAR2(30 BYTE), HZM VARCHAR2(100 BYTE), LX VARCHAR2(50 BYTE), JD VARCHAR2(20 BYTE), WBKLX VARCHAR2(100 BYTE), FUNCTIONNAME VARCHAR2(50 BYTE), FUNCTIONPARAMETER VARCHAR2(50 BYTE));
TB
CREATE OR REPLACE PROCEDURE PROC_CREATE_TB authid current_user
as
-----
sqlstr varchar2(4000);--
begin
declare ---
--
begin
select 'create'||' table '||' TB5001 (' ||wmsys.wm_concat(zdm||' '||decode( lx,'number','number('||decode(jd,'0','20','20,'||jd)||')','date','date','varchar2('||jd||')'))||')' INTO sqlstr from JGTB5001;
execute immediate sqlstr;
select 'create'||' table '||' TB5002 (' ||wmsys.wm_concat(zdm||' '||decode( lx,'number','number('||decode(jd,'0','20','20,'||jd)||')','date','date','varchar2('||jd||')'))||')' INTO sqlstr from JGTB5002;
execute immediate sqlstr;
select 'create'||' table '||' TB5003 (' ||wmsys.wm_concat(zdm||' '||decode( lx,'number','number('||decode(jd,'0','20','20,'||jd)||')','date','date','varchar2('||jd||')'))||')' INTO sqlstr from JGTB5003;
execute immediate sqlstr;
select 'create'||' table '||' TB5004 (' ||wmsys.wm_concat(zdm||' '||decode( lx,'number','number('||decode(jd,'0','20','20,'||jd)||')','date','date','varchar2('||jd||')'))||')' INTO sqlstr from JGTB5004;
execute immediate sqlstr;
select 'create'||' table '||' TB5005 (' ||wmsys.wm_concat(zdm||' '||decode( lx,'number','number('||decode(jd,'0','20','20,'||jd)||')','date','date','varchar2('||jd||')'))||')' INTO sqlstr from JGTB5005;
execute immediate sqlstr;
select 'create'||' table '||' TB5006 (' ||wmsys.wm_concat(zdm||' '||decode( lx,'number','number('||decode(jd,'0','20','20,'||jd)||')','date','date','varchar2('||jd||')'))||')' INTO sqlstr from JGTB5006;
execute immediate sqlstr;
end;
commit;
end PROC_CREATE_TB;
/