cancel
Showing results for 
Search instead for 
Did you mean: 

XMLSQL and $ Character

Former Member
0 Kudos

Hi,

I want to make an Insert statement to a DB2 Database, and one of the fields has a "$" Character, so I can not make an XML Document Format for the Mode XMB2DB_XML.

Using that Mode, what can I do?

Regards,

Luis Diego

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Luis

You can create a stored procedure in your DB2 backend and create an XML document format to execute the SP.

This is more performance efficient than using a dynamic SQL statement

Thanks

Satish

Former Member
0 Kudos

Hi,

Use special character to handle escape characters

See the below link

http://help.sap.com/saphelp_erp2005vp/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm

Also see the below Q SAP Note 831162

• Q: I am sending a SQL_QUERY or SQL_DML statement that makes use of placeholders to a JDBC Receiver, which looks as follows:

<?xml version="1.0" encoding="UTF-8" ?>

<root>

<stmt>

<Update action="SQL_DML">

<access>

UPDATE TABLE SET Name='$NAME$' WHERE ID='$ID$'

< /access>

<key>

<NAME>Joe's Name</NAME>

<ID>42< /ID>

</key>

</Update>

</stmt>

</root>

When executing the resulting query, my DBMS reports an error similar tothe following one:

"SQL command not properly ended"

Why doesn't the JDBC receiver escape the apostrophe I use within my placeholder's data?

Regards

Chilla

<i>reward points if it is helpful..</i>

Former Member
0 Kudos

Hi Chandra,

Thanks for your reply. What I mean is, I have a "Database field" with a $ Character.

Like this:

[code]

<?xml version="1.0" encoding="UTF-8" ?>

<root>

<stmt>

<Update action="SQL_DML">

<access>

UPDATE TABLE SET CU$FNLK='$NAME$' WHERE ID='$ID$'

< /access>

<key>

<NAME>Joe's Name</NAME>

<ID>42< /ID>

</key>

</Update>

</stmt>

</root>

[/code]

What can I do?

Regards,

Luis Diego