• 谈谈oracle中的临时表


    --------------------创建临时表 临时保存从xml字符串解析来的数据---------------------------

    会话级别临时表
    SQL> create global temporary table temp_order01 (orderid number,ordernumber number,orderdate date) on commit delete rows;

    Table created.

    事务级别临时表
    SQL> create global temporary table temp_order02 (orderid number,ordernumber number,orderdate date) on commit preserve rows;

    Table created.

    SQL> INSERT INTO TEMP_ORDER SELECT * FROM XMLTABLE('$B/orderlist/order' PASSING
    XMLTYPE('<?xml version="1.0" encoding="gb2312" ?>&V_XML') AS B
    COLUMNS orderid number PATH '/order/orderid',
    ordernumber number PATH '/order/ordernumber',
    orderdate date PATH '/order/orderprice');
    Enter value for v_xml: <orderlist><order><orderid>1</orderid><ordernumber>01</ordernumber><orderdate>sysdate</orderdate></order></orderlist>
    old 2: XMLTYPE('<?xml version="1.0" encoding="gb2312" ?>&V_XML') AS B
    new 2: XMLTYPE('<?xml version="1.0" encoding="gb2312" ?><orderlist><order><orderid>1</orderid><ordernumber>01</ordernumber><orderdate>sysdate</orderdate></order></orderlist> ') AS B

    1 row created.


    SQL> select * from temp_order;

    ORDERID ORDERNUMBER ORDERDATE
    ---------- ----------- ---------
    1 1

    SQL> commit;

    Commit complete.

    SQL> select * from temp_order;

    no rows selected


    <orderlist><order><orderid>1</orderid><ordernumber>01</ordernumber><orderdate>sysdate</orderdate></order></orderlist>

  • 相关阅读:
    Vimium -为键盘而生
    Sublime Text 3 修改配色主题【侧边框之...】
    MyBatis-Plus文档地址
    解决:电脑新建文件后需要刷新才显示
    技术书籍博客
    js获取浏览器当前窗口的高度长度
    DataGridView隐藏列用CSS实现
    判断windows操作系统平台
    iis7.5错误 配置错误
    vmware安装mac
  • 原文地址:https://www.cnblogs.com/iyoume2008/p/4861583.html
Copyright © 2020-2023  润新知