A customizable example for different result sets

This section demonstrates how you can store the data from XML documents in a Sybase IQ database using the ResultSet class and its methods for handling result sets. You can customize the ResultSet class for your database application.

Contrast the ResultSet document type and the Order document type:

For this example, you create and work with XML ResultSet documents that contain the same data as the XML Order documents.

First, create the orders table and its data:

create table orders 
 	(customer_id varchar(5) not null,
 	order_date datetime not null,
 	item_id varchar(5) not null,
 	quantity int not null, 
 	unit smallint default 1)
insert into orders values ('123', '1999/05/07', '987', 5, 1)
insert into orders values ('123', '1999/05/07', '654', 3, 12)
insert into orders values ('123', '1999/05/07', '579', 1, 1)