cancel
Showing results for 
Search instead for 
Did you mean: 

Insert multiple rows into a database table using the JDBC adapter

Former Member

Hi,

I need to insert multiple rows into a database table using the JDBC adapter (receiver). I have to load the item level details from a ship order(idoc,SAP) to the table. There are multiple E1EDL24 segments, which i have mapped to the <key> inside the <statement>block.

I tried using both:

- separate queries for each row (result generates multiple <statement>, each having individual <access> holding the query)

- single query to do multiple inserts (result generates a single <statement> having n <keys>; n=no: of E1EDL24 segments)

The problem is that I can see mutiple <keys> generated as required (in the RWB>Messsage Moni> Message Content); but only the very first item-level detail record is getting inserted into the db table....

Can you suggest something?

P.S: I tried enabling "batch mode"(advanced adapter properties) and adding entry logSQLStatement =true.

Dint work

Thank you

Regards,

Smitha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you just have an Insert scenario then you no need to define the key structure.

<StatementName2>

<dbTableName action=u201DINSERTu201D>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2</col2>

</access>

<access>

<col1>val11</col1>

</access>

</dbTableName>

</StatementName2>

In this case you can repeat the access node for each record and try.

If you have insert/update case then

<StatementName1>

<dbTableName action=u201DUPDATEu201D | u201CUPDATE_INSERTu201D>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2new</col2>

</access>

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName>

</StatementName1>

In this case try repeating dbtablename each time you want to insert a records.

you can refer to http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm

Gaurav Jain

Edited by: Gaurav Jain on May 19, 2008 6:04 PM

Former Member
0 Kudos

Thank you to soumya and madhu for ur suggestions and weblinks. Gaurav's suggestion to use multiple access tags have solved my problem. Gaurav thanks a lot!

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Smitha,

Follow the below link.

Thanks,

Soumya