Updating fields directly using Progress

alan180274

New Member


We are using the ERP system MFG/Pro which uses a progress database.
I am relative progress novice, but i know how to retrieve and outpur data
via the For each and output commands.

however, how do i update a field directly in a progress table without having to
use the erp screen.

do i use update or set ? I tried using as an example
to set the currency to GBP for a particualr customer.

for each ar_mstr where ar_num = "02001975":
set ar_curr = "GBP".
end.

however this did not work - could anyone please advise ?

regards

Alan​
 
First of all, you should include EXCLUSIVE-LOCK in your FOR EACH statement so that the record is locked. Good practice is also to prefix the field names with the table name. The ASSIGN is not necessary you could ommit it.

for each ar_mstr where ar_mstr.ar_num = "02001975" EXCLUSIVE-LOCK:
ASSIGN ar_mstr.ar_curr = "GBP".
end.



Good luck, RealHeavyDude.
 
Thanks- I tried what yo advised- see below.

for each ar_mstr where ar_mstr.ar_bill = "0021975"
and ar_mstr.ar_nbr = "INV67461" exclusive-lock:
assign ar_mstr.ar_curr = "YEN".
end.

I got error that cannot complie programs that update the databse in this version, when i try to run. I am on a very old version 74g7.
Is there a way round this?
 
You need a development license in order to be able to compile 4GL code.

Even if you just run it in the procedure editor it gets compiled on-the-fly in the background and executed against the database. There is no way to run uncompiled 4GL code against the 4GL database engine.


Regards, RealHeavyDude.
 
Note, if you know only this much about Progress, be cautious about it being just enough to be dangerous. Setting values outside the application means that you are bypassing the business logic related to the field ... potentially causing all sorts of interesting problems. Make sure you know the implications before doing any such updates.
 
Back
Top