• How to Delete XML Publisher Data Definition Template


    DECLARE
      -- Change the following two parameters
      VAR_TEMPLATECODE  VARCHAR2(100) := 'CUX_CHANGE_RPT1'; -- Template Code
      BOO_DELETEDATADEF BOOLEAN := TRUE; -- delete the associated Data Def.
    BEGIN
      FOR RS IN (SELECT T1.APPLICATION_SHORT_NAME TEMPLATE_APP_NAME,
                        T1.DATA_SOURCE_CODE,
                        T2.APPLICATION_SHORT_NAME DEF_APP_NAME
                   FROM XDO_TEMPLATES_B T1, XDO_DS_DEFINITIONS_B T2
                  WHERE T1.TEMPLATE_CODE = VAR_TEMPLATECODE
                    AND T1.DATA_SOURCE_CODE = T2.DATA_SOURCE_CODE) LOOP
        XDO_TEMPLATES_PKG.DELETE_ROW(RS.TEMPLATE_APP_NAME, VAR_TEMPLATECODE);
        DELETE FROM XDO_LOBS
         WHERE LOB_CODE = VAR_TEMPLATECODE
           AND APPLICATION_SHORT_NAME = RS.TEMPLATE_APP_NAME
           AND LOB_TYPE IN ('TEMPLATE_SOURCE', 'TEMPLATE');
        DELETE FROM XDO_CONFIG_VALUES
         WHERE APPLICATION_SHORT_NAME = RS.TEMPLATE_APP_NAME
           AND TEMPLATE_CODE = VAR_TEMPLATECODE
           AND DATA_SOURCE_CODE = RS.DATA_SOURCE_CODE
           AND CONFIG_LEVEL = 50;
        DBMS_OUTPUT.PUT_LINE('Selected template has been ' VAR_TEMPLATECODE
                             ' deleted.');
        IF BOO_DELETEDATADEF THEN
          XDO_DS_DEFINITIONS_PKG.DELETE_ROW(RS.DEF_APP_NAME,
                                            RS.DATA_SOURCE_CODE);
          DELETE FROM XDO_LOBS
           WHERE LOB_CODE = RS.DATA_SOURCE_CODE
             AND APPLICATION_SHORT_NAME = RS.DEF_APP_NAME
             AND LOB_TYPE IN
                 ('XML_SCHEMA', 'DATA_TEMPLATE', 'XML_SAMPLE', 'BURSTING_FILE');
          DELETE FROM XDO_CONFIG_VALUES
           WHERE APPLICATION_SHORT_NAME = RS.DEF_APP_NAME
             AND DATA_SOURCE_CODE = RS.DATA_SOURCE_CODE
             AND CONFIG_LEVEL = 30;
          DBMS_OUTPUT.PUT_LINE('Selected Data Defintion has been '
                               RS.DATA_SOURCE_CODE ' deleted.');
        END IF;
      END LOOP;
      COMMIT;
    EXCEPTION
      WHEN OTHERS THEN
        ROLLBACK;
        DBMS_OUTPUT.PUT_LINE('Unable to delete XML Publisher Template '
                             VAR_TEMPLATECODE);
        DBMS_OUTPUT.PUT_LINE(SUBSTR(SQLERRM, 1, 200));
    END;

  • 相关阅读:
    ms sql server缓存清除与内存释放
    Linux学习23-Xftp上传文件显示乱码问题
    jmeter压测学习1-window环境准备与案例
    Linux学习22-文件上传与下载(rz,sz)
    httprunner学习16-locust性能测试
    httprunner学习15-运行用例命令行参数详解
    httprunner学习14-完整的项目结构设计
    httprunner学习13-环境变量.env
    httprunner学习12-hook 机制实现setup和teardown
    httprunner学习11-辅助函数debugtalk.py
  • 原文地址:https://www.cnblogs.com/quanweiru/p/4937018.html
Copyright © 2020-2023  润新知