Skip to Content
avatar image
Former Member

JDBC Receiver Column Issue

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Feb 03, 2017 at 03:20 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 03, 2017 at 06:47 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 03, 2017 at 07:34 PM

    Rayko,

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

    Br,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 06, 2017 at 11:28 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 08, 2017 at 10:35 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded