There are three basic ways to store XML data in Adaptive Server: element storage, document storage, or hybrid storage, which is a mixture of both.
Element storage – in this method, you extract data elements from an XML document and store them as data rows and columns in Adaptive Server.
For example, using the XML Order document, you can create SQL tables with columns for the individual elements of an order: Date, CustomerId, CustomerName, ItemId, ItemName, Quantity, and Units. You can then manage that data in SQL with normal SQL operations:
To produce an XML document for Order data contained in SQL, retrieve the data, and assemble an XML document with it.
To store an XML document with new Order data, extract the elements of that document, and update the SQL tables with that data.
Document storage – in this method, you store an entire XML document in a single SQL column.
For example, using the Order document, you can create one or more SQL tables having a column for Order documents. The datatype of that column could be:
SQL text, or
A generic Java class designed for XML documents, or
Java class designed specifically for XML Order documents
Hybrid storage – in this method, you store an XML document in a SQL column, and also extract some of its data elements into separate columns for faster and more convenient access.
Again, using the Order example, you can create SQL tables as you would for document storage, and then include (or later add) one or more columns to store elements extracted from the Order documents.