|
Mike, Let me preface this with I have no idea if this will work or not: You may want to try using a cursor instead of a simple select statement. At the end of the select statement, add "FOR UPDATE OF DBPLI_CLOSED". There's a form of the update statement where you can tell it to use the current record in a cursor but I don't recall what it is off the top of my head. Also, if your view includes all fields for both files, it may let you update it. You have to do that with MS Access to do updates when there are joins. Matt -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mike Wills Sent: Monday, January 02, 2006 4:56 PM To: RPG programming on the AS400 / iSeries Subject: Re: SQL Updateing a Join Continuing with this, I created a view to do what I need, but now I get "View or logical file CUVPOCLOSE in MNWTEST read-only." I don't see any way to make this updatable. I see one of the rules is there can't be multiple tables. On 1/2/06, Mike Wills <koldark@xxxxxxxxx> wrote: > > I have this select stmt: > SELECT * FROM LAWDBF7/DBPOPLI DBPOPLI, LAWDBF7/DBPOPAO > DBPOPAO WHERE DBPOPLI.DBPLI_COMPANY = DBPOPAO.DBPAO_COMPANY AND > DBPOPLI.DBPLI_PO_NUMBER = DBPOPAO.DBPAO_PO_NUMBER AND > DBPOPLI.DBPLI_LINE_NBR = DBPOPAO.DBPAO_LINE_NBR AND ( ( > DBPLI_CLOSED_FL = 'N' AND DBPLI_CANCELLED_FL = 'N') AND > DBPLI_QUANTITY = DBPLI_APPROVE_QTY AND DBPLI_REC_QTY = > DBPLI_APPROVE_QTY) > > I am want to update a field in DBPOPLI without the join it would be > something like > UPDATE MNWTEST/DBPOPLI SET DBPLI_CLOSED_FL = 'Y' > WHERE ((DBPLI_CLOSED_FL = 'N' AND > DBPLI_CANCELLED_FL = 'N') AND > DBPLI_QUANTITY = DBPLI_APPROVE_QTY AND > DBPLI_REC_QTY =DBPLI_APPROVE_QTY) > > I found some help on a site on how to do this with DB2 here (http://www.devx.com/tips/Tip/14577 ) > however, it appears like iSeries doesn't support this method of updating > records. (I know iSeries isn't technically DB2, but generally it has worked > in the past). We are on V5R3 now. How would I do this short of a simple > program which I am about ready to write. > > -- > Mike Wills > koldark@xxxxxxxxx > http://mikewills.name > Want Gmail? Email koldark+gmail@xxxxxxxxx to get on my waiting list. > > "There are 10 types of people in the world: those who understand binary, > and those who don't." -Unknown -- Mike Wills koldark@xxxxxxxxx http://mikewills.name Want Gmail? Email koldark+gmail@xxxxxxxxx to get on my waiting list. "There are 10 types of people in the world: those who understand binary, and those who don't." -Unknown
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.