cancel
Showing results for 
Search instead for 
Did you mean: 

WHEN DOES UPDATE HAPPEN IN JDBC SENDER Adapater

Former Member
0 Kudos

Hi folks ,

I am using jdbc sender adapater to call RFC function and the o/p pf the RFC i am writing to the file

This is my select query

SELECT * FROM ULIDTA2.F5631505 WHERE QSINTF='N'

and mu update query is

Update ULIDTA2.F5631505 set QSINTF='Y' where QSINTF='N'

now the slect returns multiple rows and i want the rfc to be called depending on the number of rows i get 4m select . but wht is happening is i find that seleect picks the first row calls the rfc writes to the file and updates the query .

hence other rows are not able to be processed .

does jdbc sender update as soon as it picks the select query . how do i update one row at a time .

thks

amit

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Amit,

The jdbc sender adapter does Update the rows immediately as soon as the select query is executed.

But, the multiple rows selected will be available in your source message if your statement has an occurence of 0 to unbounded.

Also, to make an RFC call for every row selected, then you will have to put the RFC call inside a loop in your BPM.

Do let me know if u need any clarifications,

Regards,

Bhavesh

Former Member
0 Kudos

Does any one one know how can we control in select statement to select 1 row at a time

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Amit,

I dont think one row at a time is possible with the SELECT query as the JDBC adapter is going to return all the rows that satisfy your query.

One work around would be to develop a Stored Procedure in your Datbase, and then use the same Stored Procedure as your select query. Now, tits the task of the stored procedure to make sure only one row is selected at a time.

Just look at Query SQL Statement part ubnder this link,

http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm

Regards,

Bhavesh

Former Member
0 Kudos

in what condition does the loop end sometimes 5 rows sometimes 8 rows

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Amit,

Sorry for the confusion here. You will have to use a BLOCK step (and not a loop like mentioned in my previous post)to send your RFC request message for every row of your Database.

Your Block can be for each or par for each.

Regards,

Bhavesh

Former Member
0 Kudos

i find this whole thing bit complicated . why cant i write a java function and do the update there based on the primary key .

i select one row and update that row in the function

and performance should be better than contrillong the flow in BPM

wht do u have to say

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Amit,

Well that is a work around which can work. But istead of your BPM getting executed once, it will get executed multiple times. But it is a solution that you can use.

Next, if you want to update using a user Defined Function, then in your JDBC sender adapter, the update statement has to be <TEST>.

Regards,

Bhavesh

Answers (0)