Oracle access to XML-formatted data

Source: Internet
Author: User
Most of the examples on the oracle|xml| data network are wrong

The key to
is to set the label for the row to RowTag, such as:


<?xml version= ' 1.0 '?>


<root>


<record>


<column1>aaaa</column1>


<column2>bbbb</column2>


</record>


</root>


, if your watch is
,

Table AAA


(


AAA varchar (20),


BBB varchar (20)


)





so to specify which label is the record to begin with. We're going to specify
here.

Save.setrowtag ("Record");


generally the XML obtained from the original table is fixed with Rowsettag and RowTag. Name is


Rowset and Rwo


For example:


<?xml version= ' 1.0 '?>


<ROWSET>


<row num= "1" >


<column1>aaaa</column1>


<column2>bbbb</column2>


</ROW>


</ROWSET>


but you specify the name you want before you get the string:


Qry.setrowsettag ("tablename");


Qry.setrowtag ("Recordname");


, this will get
.

<?xml version= ' 1.0 '?>


<TABLENAME>


<recordname num= "1" >


<column1>aaaa</column1>


<column2>bbbb</column2>


</RECORDNAME>


</TABLENAME>


So when you write it, just specify the corresponding label as RowTag:


Save.setrowtag ("Recordname");


save.insertxml (XML); OK.








In addition, it is particularly noteworthy that XML is case-sensitive, and that your recordname and recordname are two different tag











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.