Re: [AS400 Query Syntax Help Needed]

b_gilmore

Well Known Member
Re: [AS400 Query Syntax Help Needed]

UPDATE DEVDTA.F5503 AS A SET A.CODOCO = (
SELECT B.NEWDOCO FROM DEVDTA.TBL_LEASECOPY.OLDOCOSET AS B WHERE
A.CODOCO = B.OLDDOCOSET;

This will update the CODOCO field for ALL records in the F5503 so columns that
don't have a matching OLDDOCOSET in TBL_LEASECOPY will be set to NULL. If you
don't want this behavior, just add a WHERE clause to the end of the statement
which only includes the F5503 records you do wish to update. The only other
thing that gives me pause is that you are joining on the column you are also
updating in the F5503. I'm gonna say this will work but could say for sure
without a little testing (i.e. make backups ;)

BG

rhunt <[email protected]> wrote:

information for OneWorld. We need to change some lease numbers to a new
number. Using a translation table I am trying a syntax that will work on SQL
server...but the AS400 is giving me some trouble. It keeps saying "Inner Join
unexpected" Anyone know what is wrong?UPDATE DEVDTA.F5503INNER JOIN
DEVDTA.TBL_LEASECOPY ON DEVDTA.F5503.CODOCO = DEVDTA.TBL_LEASECOPY.OLDDOCOSET
DEVDTA.F5503.CODOCO = DEVDTA.TBL_LEASECOPY.NEWDOCO;ThanksRyan Hunt
http://www.jdelist.com/ubb/showthreaded.php?Cat=&Board=OW&Number=69649
messages, login to http://www.jdelist.com/forums, click Control Panel, then
click Edit by "Subscribe / Unsubscribe from receiving board posts by email,
change message notifications, etc." and adjust your subscription preferences.
JDEList is not affiliated with JDEdwards®
 

Similar threads

Back
Top