A server-side script

Using the SQL script in “Storing an XML ResultSet document in a SQL column”, you stored complete XML ResultSet documents in the rs_doc column of the resultset_docs table. The following SQL commands, executed in a server environment, reference and update the columns contained in those documents.

You can select columns by name or by number:

Specify some nonexisting columns and rows. Those references return null values.

Select rs_doc>>getcolumn(1, "itemid"), 
 	rs_doc>>getcolumn(1, "xxx"),
 	rs_doc>>getcolumn(1, "Quantity"), 
 	rs_doc>>getcolumn(99,  "unit"),
 	rs_doc>>getColumn(1, 876)
 from resultset_docs

Update columns in the stored ResultSet document:

update resultset_docs
set rs_doc = rs_doc>>setColumn(1, "ItemName", 																						“Wrench”)			
where id= “1”								
update resultset_docs
 set rs_doc = rs_doc>>setColumn(1, "ItemId", "967")
 where id=”1”
update resultset_docs
 set rs_doc = rs_doc>>setColumn(1,  "unit", "6")
 where id=”1”
select rs_doc>>getColumn(1, "ItemName"),
 	rs_doc>>getColumn(1, "ItemId"),
 	rs_doc>>getColumn(1,  "unit")
 from resultset_docs
 where id=”1”