on 06-21-2007 10:00 AM
Hi everybody!
I am posting data to a JDBC Receiver adapter using the JDBC adapter's XML format. I have configured the logging of the adapter to show the SQL commands issued to the adapter, since I received some strange errors from the database.
I now find entries like:
INSERT INTO xxx (field1, field2, field3) VALUES (value1, , value3)
Notice the "missing" value2 - the field's value is a space character (" "). However, I actually wanted to quote the values in this field, since this SQL command of course gives a syntax error because of the two consecutive commas...
How can I quote strings in this SQL command?
Regards, Joerg
Hi
You need to enclose the string within single quotes
regards
krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I don't know if I stated my problem clearly enough... Here is the XML document I post to the JDBC adapter:
<root>
<insert>
<xxx action="INSERT">
<field1>value1</field1>
<field2> </field2>
<field3>value1</field3>
</xxx>
</insert>
</root>
(note the blank character for field2's value). If I understand your answer correctly, I should use the following instead:
<root>
<insert>
<xxx action="INSERT">
<field1>'value1'</field1>
<field2>' '</field2>
<field3>'value1'</field3>
</xxx>
</insert>
</root>
This is somewhat inconvenient, since there might be <b>NULL</b> values as well and I'd have to code manymany <b>if</b> statements and <b>mapWithDefaults</b>, then. I was wondering if there is something like the config setting "Interpretation of Empty String Values" for NULL values, some switch I set globally in order to <i>always</i> quote a string...
Regards, Joerg
Hi joerg
sorry .I did not get your question correctly. Now, as suggested add the hasQuot attributed
<root>
<insert>
<xxx action="INSERT">
<field1 >value1</field1>
<field2 hasQuot="Yes" > </field2>
<field3 > value1</field3>
</xxx>
</insert>
</root>
There is no need to add any explicit ' ' as i suggested earlier
regards
krishna
Hi Joerg,
I am sure there is a way out . I dont remember exactly what i did.
But i am sure i didnt add hasQuote , i didnt add ' ' in mapping 2.
You can try this..If a certain value might not exist in the target what you can possibly do is..
When you create the datatype give the occurrence as 0..1 .
I think this might work.
Regards,
Sumit
Joerg,
You need to add the attribute, hasQuot to the fields <b>field1, field2, field3</b>. Look into help.sap for document formats.
http://help.sap.com/saphelp_nw70/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
Regards,
Jai Shankar
Message was edited by:
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.