Talk about temporal tables in Oracle

Source: Internet
Author: User

--------------------create temporary tables to temporarily save data parsed from an XML string---------------------------

Session-Level staging table
Sql> Create global temporary table Temp_order01 (OrderID number,ordernumber number,orderdate date) on commit Delete row S

Table created.

Transaction Level Temp Table
Sql> Create global temporary table Temp_order02 (OrderID number,ordernumber number,orderdate date) on commit preserve R oWS

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>

Talk about temporal tables in Oracle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.