Is this sql statement ok?

Albert4543

New Member
Code:
for each orders where invdate >= 08/01/2007 and saleman = "Jim".
exclusive-lock:
update saleman = "Al".
end.

I like to change every invoice with dates after 08/01/2007 having salesman name Jim to Al
 
1. This is not SQL, it is ABL You can submit this code via a Progress editor, but not via a SQL tool.

2. Please get in the habit of *always* qualifying column names, i.e., "Orders.invdate", not just "invdate".

3. UPDATE is a user interaction verb; what you want here is ASSIGN.


Other than that and not knowing anything about indexes and efficiency, seems fine. :) At least, as long as you don't mind making mass updates on historical data with no audit trail.
 
Back
Top