simple progress program to edit fields...help

jmcurl

New Member
I'm running Progress 91D on Linux dealing with MFG/PRO.

I want to modify a field (pt_fr_class) on all part numbers (pt_part) that begin with "MD". I want to put "37085" in the field (pt_fr_class) for all the parts that begin with "MD".

Here is the code I have that will display the information, but I don't know how to modify the data. Is it an update statement? Assign Statement? I've been through the Progress Programming Handbook and Language Reference books and am still stumped.

FOR EACH pt_mstr WHERE pt_part BEGINGS "MD":
DISPLAY pt_part pt_fr_class.
END.


Thanks in advance,

Jeffery
 
FOR EACH pt_mstr WHERE pt_part BEGINGS "MD":
/* this will prefix 337085 to whatever is already in pt_fr_class */
ASSIGN pt_fr_class = "337085" +
pt_fr_class .
DISPLAY pt_part pt_fr_class.
END.


Since you are not explicitly locking the table, make sure no one will be updating the same table.
 
You've received the answer on how to update the data. Pretty simple. But now you need to ensure that this data isn't used elsewhere in your system. If it is then you need to update it appropriately.
 
[FONT=r_ansi]When I run the following code it displays the correct pt_fr_class but it doesn't seem to actually update the database. None of the pt_fr_class records actually got changed for each pt_part in the database.

FOR EACH pt_mstr WHERE pt_part BEGINS "MD" EXCLUSIVE-LOCK:
/*ASSIGN pt_fr_class = "337085".*/
DISPLAY pt_part pt_fr_class.
END

Don't I need an update somewhere? I also get the following error message but am able to work through it. [FONT=r_ansi]

triggers/ptw.t Shared variable global_user_lang_dir has not yet been created.
(392)
[/FONT]
[/FONT]
 
My apologies. I commented out that line just for troubleshooting purposes to make sure it was the ASSIGN statement that was giving me the error. It was not commented out when i ran the program.
 
So you still have a problem reassigning the values?

From what I read, you have a write-trigger on the table ptmstr, that fires and that gives you the "global shared global_user_lang_dir error". Because of this error, everything you try to do (assign) will be undone (the transaction is undone).
So the net-result is that nothing changes.
You need to work out what the trigger does and make sure that also gets the right information (def new shared var global_user_lang_dir and assign global_user_lang_dir = what it needs)
 
The variables starting with "global_ " are MFG Session variables.
In order to define them all during a Progress editor session add a first line in your program:

{mfdeclre.i}

To fill the session variables you have to login to MFG first and then go to the Progress editor.
 
I just used a CIM program to do what I wanted. It was a little more time consuming, but the job is done.

Thanks,
 
Back
Top