Introducing the way to access XML format data under Oracle

  

The current programming and development are mostly object-oriented, so using XML to express data can make data processing and dissemination very convenient. To this end, today Xiaobian share with you Oracle access to XML format data, because you may encounter some trouble when using XML to store data, so this tutorial should pay special attention and patience.

Most of the examples on the Internet are wrong

The most important thing is to set the label representing ROW to rowTag, for example:

aaaa

bbbb
< If your table is

table aaa

(

aaa varchar(20),

bbb varchar(20)

)

Then specify which label is the beginning of the record. Here you have to specify

save.setRowTag("record");

Generally from the original table The resulting XML is named with fixed rowsettag and rowtag.

ROWSET and RWO

For example:

aaaa

bbbb

But before you get the string, you can specify the name you want:

qry.setRowSetTag("TABLENAME");

qry.setRowTag("RECORDNAME");

This is Will get

aaaa

bbbb

So when you write in, just specify the corresponding label as ROWTAG:

save.setRowTag(" RECORDNAME");

save.insertXML(xml); Just OK.

Also, pay special attention to XML is case sensitive, your RECORDNAME and recordname are two different tags. ,

XML helps simplify the persistence of objects and makes data persistence a common development process. By serializing the data object into an XML document, you can create an object document and then use the BLOB field type to conveniently store the XML document in the database.

Copyright © Windows knowledge All Rights Reserved