Simple Update Program...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
 
**theoretically it's simple
all you need to do is assign the value

i.e. field = value, see code snippet bellow

progress will add all the rest implicitly
transaction, locking specifics etc. or you can specify it explicitly


i said theoretically because you know nothing about
the referential integrity

the tables have some relationship between them


for example if i woke up one day
and decided to change all the pt_part format

say add a letter at the beginning

i would break all the joins
to this table with all the other tables in the database

( in any case you wouldn't be able to change the primary key.
unless you were using GUID's like in dynamics, but let's leave that for now )


another example is if i directly changed the
amount of an order detail or better yet deleted that order line

if there was some summary it would be corrupted


point is you can't just directly reach into the database and change it
there are alot of data that has to be maintained along with it ( denormalization )

or you'll run the risk of corrupting your database


in mfg/pro i think you would run a "cim"

that would use one of the regular maintenance programs
to make changes to the data

it's just a batch process
that get's the input from a file instead of the keyboard


<snippet>
FOR EACH pt_mstr WHERE pt_part BEGINGS "MD":

pt_fr_class = "37085".

DISPLAY pt_part pt_fr_class.
END.
</snippet>
 
????

Why are you hardcoding the criteria???? More efficient to use something like;

<snippet>

FOR EACH pt_mstr WHERE pt_part BEGINS cCriteriaVar NO-LOCK:
DISPLAY
pt_part
pt_fr_class.
END.

<snippet>
Makes sure Progress uses index more efficientley
 
Dude,
Try something similar to;

ASSIGN
c_var ="MD".
.

FOR EACH pt_mstr WHERE pt_part BEGINGS c_var:

DO:
/* modify a field (pt_fr_class) on all part numbers (pt_part) that begin with "MD" */
END. /* DO (modify) */

END. /* FOR EACH pt_mstr WHERE pt_part BEGINGS c_var */

/* external code here - outside loop */
 
Back
Top