Not knowing much about SQL queries, I think I Can answer your question.
Code:
/*Single Find*/
find first table1 exclusive-lock
where table1.col1 = 3 /* If col1 data type is character then 3 needs to be quoted '3'...*/
no-error.
if available table1 then
do:
assign
table1.col2 = getdate()
table1.col1 = 2.
end.
Alternative Code:
Code:
/*Multiple Finds*/
For each table1 exclusive-lock
where table1.col1 = 3:
assign
table1.col2 = getdate()
table1.col1 = 2.
end.
However since I don't know the data types of the fields (.i.e char, int etc) and the structure of your indexes I am not 100% sure if this helps you. Good luck
progress supports sql statements in 4gl code (esql) so you can use it as it is. the only thing which might be a problem is getdate function. i suppose it just returns today date in that case you shoud replace it as follows
Code:
update table1
set col1 = 2,
col2 = today
where col1 = 3
there's another thing you have to take into account - you can't use esql with temptables, so make sure that table1 isn't a temptable before trying.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.