• 存储过程由结构表生成表


    结构表

    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; /
  • 相关阅读:
    构建之法阅读笔记02
    第六周总结
    第四周总结
    课堂练习——数据爬取
    【Spring实战4】02---Spring容器
    【Spring实战4】01---初接触
    性能测试总结(三)--工具选型篇
    性能测试总结(二)---测试流程篇
    性能测试总结(一)---基础理论篇
    接口测试总结【转】
  • 原文地址:https://www.cnblogs.com/siyunianhua/p/4635322.html
Copyright © 2020-2023  润新知