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
mjf
Hello,

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">

<DAD>
<validation>NO</validation>
<Xcollection>
<SQL_stmt>
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
</SQL_stmt>
<prolog>?xml version="1.0"?</prolog>
<doctype>!DOCTYPE Pict SYSTEM "/home/mydir/getstart.dtd"</doctype>
<root_node>
<element_node name="Pict">
<attribute_node name="key">
<column name="pictid"/>
</attribute_node>
<element_node name="PictInfo">
<element_node name="createdate">
<text_node>
<column name="createdate"/>
</text_node>
</element_node>
<element_node name="pictsize">
<text_node>
<column name="pictsize"/>
</text_node>
</element_node>
<element_node name="typeid">
<text_node>
<column name="typeid"/>
</text_node>
</element_node>
<element_node name="manufacturerid">
<text_node>
<column name="manufacturerid"/>
</text_node>
</element_node>
<element_node name="DefectInfo" multi_occurrance="YES">
<element_node name="defectserial">
<text_node>
<column name="defectserial"/>
</text_node>
</element_node>
<element_node name="type">
<text_node>
<column name="type"/>
</text_node>
</element_node>
<element_node name="xposition">
<text_node>
<column name="xposition" />
</text_node>
</element_node>
<element_node name="yposition">
<text_node>
<column name="yposition" />
</text_node>
</element_node>
<element_node name="xref">
<text_node>
<column name="xref"/>
</text_node>
</element_node>
<element_node name="yref">
<text_node>
<column name="yref"/>
</text_node>
</element_node>
<element_node name="xsize">
<text_node>
<column name="xsize"/>
</text_node>
</element_node>
<element_node name="ysize">
<text_node>
<column name="ysize"/>
</text_node>
</element_node>
</element_node> <!-- end DefectInfo -->
</element_node> <!-- end MaskInfo -->
</element_node> <!-- end Mask -->
</root_node>
</Xcollection>
</DAD>
~~~~~~~~~~

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

<!ELEMENT Pict (PictInfo, DefectInfo+)>
<!ATTLIST Pict key CDATA #REQUIRED>
<!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 type (#PCDATA)>
<!ELEMENT xposition (#PCDATA)>
<!ELEMENT yposition (#PCDATA)>
<!ELEMENT xref (#PCDATA)>
<!ELEMENT yref (#PCDATA)>
<!ELEMENT xsize (#PCDATA)>
<!ELEMENT ysize (#PCDATA)>
~~~~~~~~~~~

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

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

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.