|
|
Question : Modifying SQL Statement in AS400 Stored Procedure
|
|
|
|
I have a stored procedure in an AS400 database (V5R4) which I now need to modify. The procedure pulls data from a CSV File and uses it to compare against a database and returns a selected group of columns from 1 table. Now I need to add a Left outer join to another table as part of the return data.
Here is the original query: 'SELECT ' || COLS || ' FROM SCDATA.SCACCT as AC RIGHT OUTER JOIN QTEMP.TEMPACCT as TMP ON AC.GACCT# = TMP.ACCT OR AC.GACCT# = TMP.ACC2' ;
I need to add a join to SCDATA.SCCLNT on SCACCT.GCLNT= SCCLNT.CCLNT to return the column SCCLNT.CLTGRP. I have tried a number of approaches including adding the CLTGRP column at the call to this procedure, none of which have worked. How can I combine these 3 tables to return the correct results?
|
|
|
|
Answer : Modifying SQL Statement in AS400 Stored Procedure
|
|
|
|
|