cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC adapter Update command with select

Former Member
0 Kudos

Hi experts,

I am using

select top 100 from <table> where flag = 0.

with

update <table> set flag = 1.

it is updating all the records available in table with flag = 1.

I need to update only records, which I have picked.

How I can do this ?

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>I need to update only records, which I have picked.

maybe you need to update with where statement ?

update <table> set flag = 1 where flag = 0 ?

Regards,

Michal Krawczyk

Former Member
0 Kudos

We have around 100 thousand records in data base.

& i need to pick 25000 & update the flag only for those records, which I have picked.

& system is updating all the 100 thousand records with update.

I have used Update <table> set flag = 1 where flag = 0, in this condition all the 100 thousand records have flag = 0.

& where update is running, it is updating all 100 thousand records & I need to update only records picked e.g. 25000.

Former Member
0 Kudos

Hi,

Try this....

Select * from Table_Name where flag = 0 and rownum<25000

Update Table_Name set flag = 1 where flag = 0 and rownum<25000

Regds,

Pinangshuk.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

As described in Sender JDBC adapter help

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm

Update SQL Statement: SQL statement that is to be applied to the database once the data ( determined from the Query SQL Statement ) has been successfully sent to the Integration Server/PCK.

So all you need to do it is:

Query SQL Statement: SELECT TOP 100 FROM <table> WHERE flag = 0

(first 100 records of your select).

Update SQL Statement: UPDATE <table> SET flag = 1 WHERE flag = 0

(update statement applied for data which determined from the Query SQL Statement ).

BR,

Dzmitry