/* 接続ユーザーと同じ名前のスキーマがない場合には以下の一行を追加
create schema XMLDEMO;
/* */
/* retrvxml - test enable collection with retrieve.exe calling */
/* dxxRetrieveXML() */
/* */
insert into db2xml.dtd_ref values('/dxxsamples/dtd/neworder.dtd', db2xml.XMLClobFromFile('/dxxsamples/dtd/neworder.dtd'), 0, 'anita', 'anita','anita');
/* -------- Create result_tab -------- */
create table XMLDEMO.result_tab(doc db2xml.XMLVarchar, DXX_VALID integer);
/* create collection "abc" with validation check */
CALL XMLDEMO.QZXMADM('enable_collection','ASDOMINO','abc','/dxxsamples/dad/neworder.dad');
SELECT * FROM QOUTPUT as S1;
/* insert data to tables */
insert into XMLDEMO.order_tab values(1, 'American Motors', 'parts@am.com');
insert into XMLDEMO.part_tab values('red', 156, 1795.4, 0.02, 17, 1);
insert into XMLDEMO.part_tab values('black', 68, 3485.16, 0.06, 36, 1);
insert into XMLDEMO.part_tab values('red', 128, 3800.00, 0.07, 28, 1);
insert into XMLDEMO.ship_tab values('1998-03-13', 'TRUCK', 'This is the first shipment to service of AM.', 156);
insert into XMLDEMO.ship_tab values('1999-01-16', 'FEDEX', 'This the second shipment to service of AM.', 156);
insert into XMLDEMO.ship_tab values('1998-08-19', 'BOAT', 'This shipment is requested by a call. from AM marketing.', 68);
insert into XMLDEMO.ship_tab values('1998-07-23', 'AIR', 'This shipment is ordered by an email.', 68);
insert into XMLDEMO.ship_tab values('1998-12-30', 'TRUCK', NULL, 128);
/* retrieve collection "abc". Result document will have two /Order/Part (Key=68 and Key=128) */
CALL XMLDEMO.Retrieve('ASDOMINO','abc','result_tab','doc','DXX_VALID');
/* retrieve collection "abc" with XML Override. Result document will have one /Order/Part (Key=128) */
CALL XMLDEMO.Retrieve('ASDOMINO','abc','result_tab','doc','DXX_VALID','-o XML_OVERRIDE /Order/Part/Key > 100');
SELECT * FROM QOUTPUT as S2; /* -------- Display the resulting XML documents -------- */ select * from XMLDEMO.result_tab; /* cleanup */
commit;
drop table XMLDEMO.order_tab;
drop table XMLDEMO.part_tab;
drop table XMLDEMO.ship_tab;
drop table XMLDEMO.result_tab;
CALL XMLDEMO.QZXMADM('disable_collection','ASDOMINO','abc');
SELECT * FROM QOUTPUT as S3;
delete from db2xml.dtd_ref where dtdid='/dxxsamples/dtd/neworder.dtd';
Ads by TOK2