cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot insert empty elements in jdbc table

Former Member
0 Kudos

HI all,

if have a RFC - XI - JDBC Scenario.

Normaly it works fine. But if there in a table field is no content the XI this error occurs:

com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'MYTAB' (structure 'Statement'): java.sql.SQLException: ORA-01400: cannot insert NULL into ("BSM"."MYTAB"."MYTAB_RATIN").

In the communications channel of the jdbc-adapter in feld 'Interpretation of empty String' I choose 'Empty String'.

But it doesnt seems to help.

Are there any Ideas?

Regards

Mathias

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Yes we can do it,

you can map the field with mapwithdefault message mapping function by assigning some value or empty.

Also

we have provision to handle the empty values in receiver JDBC adapter

see below

<b>XML Schema Interpreter with Message Protocol XML SQL Format</b>

<b>Field Entry</b>

Key Tags Mandatory

Set the indicator to specify that there must be conditions in the key tag.

Interpretation of Empty String Values :

Specify how empty text fields are to be handled.

&#9679; NULL value

In the case of INSERT and UPDATE statements, empty fields are handled like NULL fields (do not exist) and are not inserted in the database.

&#9679; Empty string

In the case of INSERT and UPDATE statements, empty texts are inserted in the columns.

see here for more details

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

Regards

Chilla..

Former Member
0 Kudos

There are primary keys ie mandatory fields in your table.So It will not allow to insert empty strings.

bhavesh_kantilal
Active Contributor
0 Kudos

Mathias,

1. Do you create a Empty String in your Message during the mapping for the empty element?

2. Also, use the LogSQL statement and check what is the actaul SWL statement created in by your Receiver JDBC adapter and see if it is as expected.

Regards

Bhavesh

Former Member
0 Kudos

I created an Empty String in my Message during the mapping for the empty element and only on this way I could send the message succesfully.

But I am wondering, because this should be the task of the XML-Schema-Interpreter (handling of empty strings) in the jdbc Adapter (for mandatory fields too).

I have a lot of tables and a lot of fields and so I think this cant be a good solution!

Former Member
0 Kudos

HI,

Try

&#9679; NULL value

In the case of INSERT and UPDATE statements, empty fields are handled like NULL fields (do not exist) and are not inserted in the database.

Regards

Chilla

Former Member
0 Kudos

Mathias.

But I am wondering, because this should be the task of the XML-Schema-Interpreter (handling of empty strings) in the jdbc Adapter (for mandatory fields too).

No it does not handle this.

Former Member
0 Kudos

Mathis,

"MYTAB"."MYTAB_RATIN" these two fileds are mandotry fields and does not allow null values so your getting the error.

so to over the error you need send some values or changes table strucute in oracle by making these 2 field by removing not null and not mandtory.

Regards

sreeram.g.reddy

Message was edited by:

Sreeram Reddy