cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC creates blank instead of NULL

Former Member
0 Kudos

Hi,

I have a receiver JDBC adapter setting where I said 'Interpretation of Empty String Values = NULL'. The structure I send to this JDBC definition looks like this:

<ns1:Insert_Zertifikat_Rumpf xmlns:ns1="http://EU/...">

<Insert_Rumpf>

<MQE_RUMPF action="Insert">

<access>

<ORIG_TMST>2006-06-08.11.19.00.255000</ORIG_TMST>

<STATUS>NEW</STATUS>

<BENUTZERKENNUNG />

.

.

.

In general it works, I can see the data inside the database table MQE_RUMPF. But the column 'BENUTZERKENNUNG', an empty column in the XML data to the JDBC adapter is not NULL but filled with one blank ' '. This is true for all empty elements. Only elements not contained in the XML are NULL in the DB table.

Any idea what's wrong there?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

If you use the graphical mapping add "trim" to the field. It solved a similar problem for myself. For Abap or Xslt I have no solution on hand right now.

Former Member
0 Kudos

Yes, I use the graphical mapping. Thanks for the tip with "trim", but this does not work in this case. JDBC adapter creates a blank in the destination column of the DB table although an empty element like '<BENUTZERKENNUNG /> is send within the message to the adapter.

I found a work around: you have to delete empty elements in the message to JDBC adapter. Then the adapter creates NULL in the table columns. With graphical mapping this is a complex construct with 'exist' an 'length' and two 'if'. So I created a user defined function with 5 lines of java code.

Thanks a lot for all the answers.

moorthy
Active Contributor
0 Kudos

check this <b>configuration SAP help-under

XML Schema Interpreter with Message Protocol XML SQL Format</b>http://help.sap.com/saphelp_nw2004s/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm

Regards,

Moorthy

Former Member
0 Kudos

Closely look into the JDBC Adapter, in one field they will ask you how do you want to send the Blank field, I hope that field is causing the problem.

Former Member
0 Kudos

I guess you mean the setting for 'Interpretation of Empty String Values'. This you can set to NULL or Empty String. I've set it to NULL. Even if I've set it to Empty String the JDBC adapter should not create a single blank.