cancel
Showing results for 
Search instead for 
Did you mean: 

To insert Multiple records in JDBC receiver in SAP HCI

0 Kudos

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>


peter_karg
Explorer
0 Kudos

HI Naveen, I had a look at my file and it's working to insert more records and I checked those information:

https://blogs.sap.com/2012/09/05/jdbc-receiver-best-practices-scenario-insert-operation-design-part2...

https://archive.sap.com/discussions/thread/3874247

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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

Answers (2)

Answers (2)

peter_karg
Explorer
0 Kudos

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!

0 Kudos

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

peter_karg
Explorer
0 Kudos

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

0 Kudos

Hi Peter,

Thanks for replying.

I have tried your same XML but still it is inserting only one record. please find below response:

  <root>
         <stmt_response>
            <insert_count>1</insert_count>
         </stmt_response>
      </root>



Please help me to insert many records in a table.

Regards,

Naveen