SqlDbx Forum

SqlDbx

You are not logged in.

#1 2014-09-17 16:10:55

tphillip1120
Member

Updating Progress table using multiple tables

What I am trying to do is query information in two tables and then
update a field in one of the tables based on the results. Everything
that I have tried fails with some kind of an error so I am looking for
some guidance. I am not a Sql Programmer or Developer but
use Sqldbx to mass update some fields in our database one in
awhile. I am using sqldbx against a Progress 10.1C Database
using the Progress Supplied ODBC Driver. Simple Update Statements
using only one table work find such as:

Update pub.arsc Set slsrepout = 'MDW' Where cono = '1' And slsrepout = 'RAC'


The below query works and returns data:

SELECT PUB.arss.custno,PUB.arss.shipto,PUB.arsc.slsrepout AS arscslsrepout,PUB.arss.slsrepout
FROM {oj PUB.arsc LEFT OUTER JOIN PUB.arss ON PUB.arsc.custno=PUB.arss.custno}
WHERE PUB.arsc.slsrepout = 'MDW' AND PUB.arss.slsrepout <> 'MDW'


I am trying to do something like below but only receive errors:

UPDATE PUB.arss
SET pub.arss.slsrepout = 'MDW'
FROM {oj PUB.arsc LEFT OUTER JOIN PUB.arss ON PUB.arsc.custno=PUB.arss.custno}
WHERE PUB.arsc.slsrepout = 'MDW' AND PUB.arss.slsrepout <> 'MDW'


I have even tried using something like:
UPDATE PUB.arss
SET pub.arss.slsrepout = (SELECT PUB.arsc.slsrepout
FROM {oj PUB.arsc LEFT OUTER JOIN PUB.arss ON PUB.arsc.custno=PUB.arss.custno}
WHERE PUB.arsc.slsrepout = 'MDW' AND PUB.arss.slsrepout <> 'MDW')

I want to look in our arss table, and if the the slsrepout field does not equal 'MDW'
but the slsrepout field in the arsc table does match 'MDW', then update the arss.slsrepout
field to 'MDW'


Any help would be greatly appreciated.

Offline

#2 2014-09-17 20:18:16

sqldbxhelp
Administrator

Re: Updating Progress table using multiple tables

Unfortunately we do not have experience with Progress SQL so I am not sure about syntax validity of the update statement.
Are errors you getting SqlDbx related or Progress error messages?

Offline

Board footer

Powered by FluxBB