By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,586 Members | 2,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,586 IT Pros & Developers. It's quick & easy.

SQL-to-XML error when calling dxxgenx

P: n/a

I'm trying to compose a XML doc from existing DB2 tables. I have the
DAD file as follows:
<?xml version="1.0"?>
<!DOCTYPE DAD SYSTEM "/opt/IBM/db2/V8.1/samples/db2xml/dtd/dad.dtd">

SELECT m.pictid, m.createdate, m.pictsize, m.typeid,
m.manufacturerid, mds.defectnum, md.type, md.xref, md.yref, md.xsize,
md.ysize, md.xposition, md.yposition FROM pict m, pictdefectserial mds,
pictdefect md WHERE m.pictid = mds.pictid AND mds.defectserial =
md.defectserial ORDER BY m.pictid, mds.defectserial
<prolog>?xml version="1.0"?</prolog>
<doctype>!DOCTYPE Pict SYSTEM "/home/mydir/getstart.dtd"</doctype>
<element_node name="Pict">
<attribute_node name="key">
<column name="pictid"/>
<element_node name="PictInfo">
<element_node name="createdate">
<column name="createdate"/>
<element_node name="pictsize">
<column name="pictsize"/>
<element_node name="typeid">
<column name="typeid"/>
<element_node name="manufacturerid">
<column name="manufacturerid"/>
<element_node name="DefectInfo" multi_occurrance="YES">
<element_node name="defectserial">
<column name="defectserial"/>
<element_node name="type">
<column name="type"/>
<element_node name="xposition">
<column name="xposition" />
<element_node name="yposition">
<column name="yposition" />
<element_node name="xref">
<column name="xref"/>
<element_node name="yref">
<column name="yref"/>
<element_node name="xsize">
<column name="xsize"/>
<element_node name="ysize">
<column name="ysize"/>
</element_node> <!-- end DefectInfo -->
</element_node> <!-- end MaskInfo -->
</element_node> <!-- end Mask -->

And I have the DTD file as follows:
<?xml encoding="US-ASCII"?>

<!ELEMENT Pict (PictInfo, DefectInfo+)>
<!ELEMENT PictInfo (createdate, pictsize, typeid, manufacturerid)>
<!ELEMENT createdate (#PCDATA)>
<!ELEMENT pictsize (#PCDATA)>
<!ELEMENT typeid (#PCDATA)>
<!ELEMENT manufacturerid (#PCDATA)>
<!ELEMENT DefectInfo (defectserial, type, xposition, yposition, xref,
yref, xsize, ysize)>
<!ELEMENT defectserial (#PCDATA)>
<!ELEMENT xposition (#PCDATA)>
<!ELEMENT yposition (#PCDATA)>
<!ELEMENT xsize (#PCDATA)>
<!ELEMENT ysize (#PCDATA)>

but when I ran the command
dxxgenx mydb /home/mydir/ result_tab
I keep getting the following error:

-------- Calling the SQL-to-XML mapping stored procedure. --------
Connecting to database fpdb
msgtext'[IBM][CLI Driver][DB2/LINUX] SQL0104N An unexpected token
"""" was found following "ITION", "YPOSITION",". Expected tokens may
include: "<space>". SQLSTATE=42601

which means there is a syntax error in the SQL statement in the DAD
file. But I cannot find anything wrong with it. In fact if I run it on
DB2 command line, it returns two records, which is correct. Why it does
not run with dxxgenx stored procedure? I have been stuck on this for
1/2 day!
Thanks for any help.

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.