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

DB2 XMLUPDATE error executing from Java Statement

P: n/a
I am trying to use the XMLUPDATE stored procedure. Installed fine, and
seems to work great if I execute the statement from a sql query using
the controll center.. Doesn't work from java however. I get a 07004
error that says I must in clude a USING or INTO clause in my dynamic
query.

I inserted the USING="SQL" clause (as the documentation stated
somewhere) into the XML query but that didn't do anything.

Can anyone help me with this? the query works fine on its own.. so I'm
sure its not something really hard to correct.

Thanks :)

THE QUERY:

CALL DB2XMLFUNCTIONS.XMLUPDATE(
'<updates>
<update using=\"SQL\" action=\"append\" col=\"1\" path=\"/WishList\">
<Item>ne******@yahoo.com</Item>
</update>
</updates>',
'select wishlist from users where users_id=1',
'update users set wishlist=? where users_id=1', ?, ?)

Feb 5 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Most probably you have a syntax error in your query, it looks like DB2
is trying to execute the "update using" segment of your XML as an
UPDATE statement. Are you escaping special characters correctly in the
Java?
Are you using a Statement, a PreparedStatement or a CallableStatement?
The safest is to use a Statement, probably the most portable accross
JDBC Drivers.
Feb 5 '07 #2

P: n/a
I tried using all three types, statement, prepared and callable. all
result with the same error. the only thing I'm escaping is the
quotations in the xml update string..(<update using=\"SQL\" action=
\"append\" col=\"1\" path=\"/WishList\">
) It iss a static query since I'm just trying to get the thing to
work to begin with.. so there is no chance of unescaped characters in
the insterted information. I figured it might not be finding data to
substitute the ?s for.. but that wouldn't be an issue in a normal
statement..

Vasili

On Feb 5, 1:40 pm, "Otto Carl Marte" <Otto.Ma...@gmail.comwrote:
Most probably you have a syntax error in your query, it looks like DB2
is trying to execute the "update using" segment of your XML as an
UPDATE statement. Are you escaping special characters correctly in the
Java?
Are you using a Statement, a PreparedStatement or a CallableStatement?
The safest is to use a Statement, probably the most portable accross
JDBC Drivers.

Feb 5 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.