Skip to Content

To insert Multiple records in JDBC receiver in SAP HCI

Dear Experts,

While i am trying to insert two records in JDBC receiver Using below XML

But for me first record only inserting.

Please help me to insert two or three records in JDBC receiver.

Regards,

Naveen

<root>


  <stmt>


          <dbTableName action="INSERT">


              <table>table</table>


              <access>


                 <col1>1951</col1>


                              <col2>Naveen</col2>
<col3>Abc</col3>


              </access>


              <access>


                 <col1>1952</col1>


                              <col2>Raj</col2>
<col3>xyz</col3>


                        </access>


          </dbTableName> 




  </stmt>


</root>


Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Feb 07, 2019 at 04:17 PM

    Dear Naveen,

    Why don't you use a split er and make sure that the data pushed to JDBC receiver would receive 1 XML at a time so the XML would look like

    XML 1 :
    <root> <stmt> <dbTableName action="INSERT"> <table>table</table> <access> <col1>1951</col1> <col2>Naveen</col2> <col3>Abc</col3> </access> </dbTableName> </stmt> </root>

    XML 2 :
    <root> <stmt> <dbTableName action="INSERT"> <table>table</table> <access> <col1>1952</col1> <col2>Raj</col2> <col3>xyz</col3> </access> </dbTableName> </stmt> </root>

    I hope this should help you :)


    Regards

    Akash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 31, 2019 at 03:12 PM

    Hi Naveen, I had a look at my settings and there is a <stmt><dbTableName action="INSERT"><table>table</table><access> for each record.

    So it should work if the XML looks like:

    <root>
    <stmt>
    <dbTableName action="INSERT">
    <table>table</table>
    <access>
    <col1>1951</col1>
    <col2>Naveen</col2>
    <col3>Abc</col3>
    </access>
    </dbTableName>
    </stmt>
    <stmt>
    <dbTableName action="INSERT">
    <table>table</table>
    <access>
    <col1>1952</col1>
    <col2>Test</col2>
    <col3>Abc</col3>
    </access>
    </dbTableName>
    </stmt>
    </root>

    Regards Peter

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 01, 2019 at 07:06 AM

    apart from the xml setting I can only think that there is a problem with the occurence. Can you please check this too. See screenshot. Thanks!


    jdbc.jpg (31.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Peter,

      Thanks for Replying.

      I have tried the same 1 to unbound but still i am able to insert only one record in the table:

      Please help to insert many records.

      Please find below payloads:

      <root>
      <stmt>
      <dbTableName action="INSERT">
      <table>table1</table>
      <access>
      <col1>12882</col1>
      <col2>User546</col2>
      <col3>ThouheedMohamed</col3>
      </access>
      </dbTableName> 
      </stmt>
      <stmt>
      <dbTableName action="INSERT">
      <table>table1</table>
      <access>
      <col1>12883</col1>
      <col2>User516</col2>
      <col3>NaveenRaj</col3>
      </access>
      </dbTableName> 
      </stmt>
      <stmt>
      <dbTableName action="INSERT">
      <table>table1</table>
      <access>
      <col1>12884</col1>
      <col2>User596</col2>
      <col3>Sujeet</col3>
      </access>
      </dbTableName> 
      </stmt>
      </root>
      

      Regards,

      Naveen

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.