cancel
Showing results for 
Search instead for 
Did you mean: 

insert multiple rows with jdbc adapter into a database

thomas_jork
Explorer
0 Kudos

Hello

I have the follwing scenario:

RFC -> XI -> MS SQL server

I get a table with multiple rows from SAP R/3 via RFC and

would like to send it to an MS SQL server via JDBC. On

the SQL server the JDBC adapter calls a stored procedure

which finally inserts the rows into a table.

This is working fine for a single row. No problem.

But how does it work for multiple rows? Is this possible?

Or do I have to use BPM?

Thanks is advance

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi thomas,

you can do this for multiple rows also, but, what you will be doing is calling your Stored Procedure multiple times using the JDBC adapter.

In the datatype for the JDBC adapter, the

STATEMENT tag will occur for every insertion that you want to happen.

<b><StatementName></b>

<storedProcedureName action=” EXECUTE”>

<table>realStoredProcedureeName</table>

<param1 [isInput=”true”] [isOutput=true] type=SQLDatatype>val1</param1>

</storedProcedureName >

</<b>StatementName></b>

For every row create the abouve sub strcuture.

http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

Regards,

Bhavesh

Answers (2)

Answers (2)

thomas_jork
Explorer
0 Kudos

Hello

Thank you for the prompt reply.

The relation between the items element(1 ...unbounded)of

my input message and the <b>statement</b> element of the

XML-SQL message was the missing link.

Thanks again.

Regarding the fact that this XML SQL message will call

the adapter one time for every single item, is there

any problem I should keep in mind. I mean all this calls

are within a single transaction. Right?

Do you think in terms of performance?

Regards

Thomas

bhavesh_kantilal
Active Contributor
0 Kudos

Hi thomas,

Take a look at this link and the topic Isolation level For transaction.

http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm

It depends on the setting choosen by you.

If you have set it to default of the database, then it depends on the execution of the stored procedure of the DB.

Regards,

Bhavesh

Former Member
0 Kudos

Thomas,

Check if this weblog may be helpful:

/people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes

Regards

KK