[Stackoverflow] [Progress OpenEdge ABL] Update data field in progress 4gl

Not open for further replies.


Can someone please help me?

All I want to do is update a field in a table, lets say for example membership number if it meets certain conditions.

For example: I have a list of membership numbers. IF the numbers on the list match the membership number in the table - we don't do anything.

If it doesn't match - then we change the membership number to another number that is stored in my input CSV. (i know this sounds back to front, but this is just an analogy)

So in essence I am asking - how do you update a field in a database table? This doesn't seem to be working:

def stream inputStream.
def stream outStream.

def var abcData           as char extent 4 no-undo.

def var vl-XYZ# as integer.
def var vl-link# as integer.
def var vl-orig-ABC# as char.
def var vl-new-ABC# as char.
/* def var vl-error as char. */
def var vl-match as char.
def var vl-status as char.

def buffer bMembers for  members.

input stream inputStream from "/home/abc.csv".

output stream outStream to "/home/xyz.csv".

export stream outStream delimiter "'" "ABCID" "Match".
    abcData = "".
    import stream inputStream delimiter "'" abcData.

    vl-link# = integer(abcdata[1])
    vl-XYZ# = integer(abcData[2])
    vl-orig-ABC# = string(abcData[3])
    vl-new-ABC# = string(abcData[4])   .           

   for each account no-lock  where account.link# = vl-link#,
    First members no-lock where  members.XYZ# = vl-XYZ#:

        if members.abc# = vl-orig-ABC# then
                vl-status = "Needs amending".
        if members.abc# <> vl-orig-ABC# then
                vl-status = "No action needed"
                members.abc# = vl-new-ABC#.

export stream outStream delimiter "'" vl-link# vl-XYZ# vl-orig-ABC# members.abc# vl-status


Continue reading...
Not open for further replies.