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 ?

View Entire Topic
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.