Skip to Content
avatar image
Former Member

FILE 2 JDBC

hi

I am working on FILE(XML) to JDBC Scenario.

Here i have to send whole file to a single field in DB.

Field type in DB is BLOB,so it can accomidate whole file,but how can i do Many to One in Mapping,hope its not possible.Let me know if any one came across to this type of scenario

Thanks

Prabhakar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Oct 17, 2008 at 10:11 AM

    It is possible 😊

    https://blogs.sap.com/?p=40977

    Regards,

    Prateek

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 10:20 AM

    In your message mapping involve the XSLT mapping to achieve the desired result.

    Regards,

    Sarvesh

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 17, 2008 at 11:57 AM

    Its possible through a java mapping. Java mapping can convert the full payload into a single string, which you can pass on to the target node.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 09:29 PM

    Hi Venkata

    Use Normal mapping that will allow you to read a file. Normal for XML and even using FCC if require. In interface mapping use a XSLT or Java mapping to parse all the fields into one single field as a string.

    Now the scenario at Interface mapping will be

     Source(n fields) -> Graphical mapping(1 to 1 or 1to1 woth additonal) -> Target (from Graphical mapping) -> Java or XSLT (Combinig fields many to 1) -> Target2 ( 1Field) for your JDBC

    Check this thread for XSLT code

    changing-xml-message-into-a-string

    Thanks

    Gaurav

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      The Link give my Prateek has the same stuff you need.

      You need to use XSLT mapping and use CDATA in it,it will concatenate the whole XML payload(along with the XML tags) and send to one field.

      >>I WANT TO WHOLE INPUT XML TO A TARGET(BLOB ).

      Please don't use Capital letters in your post,its equivalent to shouting at other in SDN.

      Thanx

      Aamir

  • avatar image
    Former Member
    Oct 19, 2008 at 04:32 AM

    Hi,

    In addition to the above, try this...

    use a java mapping to conver the input stream to string, u can use SAX parser and n the write method between the DATA xml tags call the variable.pass it to DB, should work out.

    Check this Implementing a Java Mapping in SAP PI to remove Escape Sequences from a file

    Let me know if u require qny help on the code.

    Edited by: Ibrahim on Oct 19, 2008 6:35 AM

    Add comment
    10|10000 characters needed characters exceeded