Skip to Content
0

JDBC Receiver Column Issue

Feb 03, 2017 at 02:30 PM

84

avatar image

Hi Experts,

We need to insert a record into a DB2 table with a column name containing $ character.

This causes a problem with the receiver xml schema because $ character is not accepted in an xml element name. Please advise.

jdbc.jpg (97.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Apu Das Feb 03, 2017 at 03:20 PM
0

Hi,

You need write one custom module for this to replace the unparsable XML tags.

First, create your data type with supported character. i.e. instead of DH$SNIDE put DH_SNIDE and so on. Based on this complete your development like a normal scenario.

Secondly, Write a custom module to replace required characters as per your requirement. You can follow below URL to write the module -

https://blogs.sap.com/2014/04/11/adapter-module-replacestring/

Your module parameter will be like -

separator = ;

param1 = DH_SNIDE;DH$SNIDE

param2 = DH_RCIDE;DH$RCIDE

.

.

.

.

Thanks,

Apu

Share
10 |10000 characters needed characters left characters exceeded
Tchalkov Rayko Feb 03, 2017 at 06:47 PM
0

Hi Apu,

I tried your suggestion but I get this error:

Exception caught by adapter framework: ERROR occured parsing request:org.xml.sax.SAXParseException: Element type "DH" must be followed by either attribute specifications, ">" or "/>".

Seems JDBC adapter cannot accept xml elements with $ inside

Share
10 |10000 characters needed characters left characters exceeded
Manoj K Feb 03, 2017 at 07:34 PM
0

Rayko,

Why dot you use native XML option for this as you can directly mention the required coloumn name as constant ?

Br,

Manoj

Share
10 |10000 characters needed characters left characters exceeded
Tchalkov Rayko Feb 06, 2017 at 11:28 AM
0

Hi Manoj,

Native SQL does not work for us because we need to update multiple tables at once.

And native SQL does not allow us to use multiline statements.

Kind Regards,

Rayko

Share
10 |10000 characters needed characters left characters exceeded
Tchalkov Rayko Feb 08, 2017 at 10:35 AM
0

We came up with a workaround - creating a view for the DB2 table where column names do not contain $ sign.

And PI inserts data into the view instead of the table.

Share
10 |10000 characters needed characters left characters exceeded