|
Well, maybe I misread... which likely... I thought he was doing the SQL because he only wanted to update the suppname at the time and didn't want the lock to be released so that the I/O update can perform. My bad. Michael Schutte rob@xxxxxxxxx Sent by: rpg400-l-bounces@ To midrange.com RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc 06/02/2006 01:11 PM Subject RE: Update Operation Failure Help Please Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com> Michael, Brian was talking about table versus row (or file versus record). You're talking about row versus column (or record versus field). Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com Michael_Schutte@xxxxxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 06/02/2006 12:57 PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc Subject RE: Update Operation Failure Help Please Depending on what version you are on, the Update allows you to specify which fields to update. Update %Fields(myField) ... I believe that's the correct syntax, you should look it up before actually using it. Michael Schutte "Brian Piotrowski" <bpiotrowski@simc To oeparts.com> "RPG programming on the AS400 / Sent by: iSeries" <rpg400-l@xxxxxxxxxxxx> rpg400-l-bounces@ cc midrange.com Subject RE: Update Operation Failure Help 06/02/2006 12:42 Please PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com> Hi Andy, I need to update the specific record - I can't tell it to update SSW85 because that would refer to the entire table. Brian. -----Original Message----- From: Andy Renk [mailto:acr12345@xxxxxxxxxxxxxxxxx] Sent: Friday, June 02, 2006 11:50 AM To: RPG programming on the AS400 / iSeries Subject: RE: Update Operation Failure Help Please You are reading ssw85 but trying to update rssw85 -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Brian Piotrowski Sent: Friday, June 02, 2006 10:34 AM To: RPG programming on the AS400 / iSeries Subject: Update Operation Failure Help Please [heur] Hi All, Can someone give me a hand trying to figure out why I can't update a record when data has changed? In my code, I have an update operation near the end of the loop. Whenever my program hits this statement, I get an "Update or delete in file SSW85 without prior input operation." error. I know there are values changing because I have traced one of the values to see if it changes. For example, when I enter the loop, the field "QUARTER" is blank. However, after I do a %lookup on the index, the value becomes "Q3". Here's my current code: SetLL *LOVAL ssw85; prevSCAC = ''; prevTRLR = ''; read ssw85; DoW not %eof(); select; when trlstat = 'D' and ordersts <> 'R'; ordersts = 'R'; when trlstat = 'E' and ordersts <> 'R'; ordersts = 'R'; when trlstat = 'R' and ordersts <> 'R'; ordersts = 'R'; ENDSL; if suppname = *BLANKS; /end-free C/Exec SQL C+ update SSW85 set suppname = (select min(scsnm) from SSM01 C+ where concat(ssm01.sccd,ssm01.sclc) C+ = concat(ssw85.suppcode,ssw85.supploc)) C+ where suppcode = :suppcode and supploc = :supploc C/End-Exec C* /free ENDIF; if ordersts = *BLANK; /end-free C/Exec SQL C+ select count(*) into :ASNCOUNT from sst02 C+ where asodtp =:ordertyp and asodno =:ordernum and asplcd = :plcd C/End-Exec /free if SQLCOD <> 0; ASNCOUNT = 0; ENDIF; /end-free C* C/Exec SQL C+ select count(*) into :INVCOUNT from sst37 C+ where ivodtp =:ordertyp and ivodno =:ordernum and ivplcd = :plcd C+ and ivrvdt <> 0 C/End-Exec /free if SQLCOD <> 0; INVCOUNT = 0; ENDIF; ORDCOUNT = ASNCOUNT - INVCOUNT; Select; When ORDCOUNT = ASNCOUNT; OSTATUS = 'O'; When INVCOUNT < ASNCOUNT; OSTATUS = 'P'; When ORDCOUNT = 0; OSTATUS = 'R'; ENDSL; /end-free C/Exec SQL C+ update ssw85 set ordersts = :OSTATUS C+ where plantcde = :plantcde and ordertyp=:ordertyp C+ and ordernum = :ordernum C/End-Exec /free ENDIF; curSCAC = scaccode; curTRLR = trlrnum; if %trim(curscac)+%trim(curtrlr) = %trim(prevSCAC)+%trim(prevTRLR); quarter = curQTR; else; idxQTR = %lookup((%char(pseqrrn)+%trim(%char(pseqsub))):arrPRODSEQ); quarter = arrQTR(idxQTR); curQTR = quarter; prevSCAC = curSCAC; prevTRLR = curTRLR; ENDIF; update rssw85; read ssw85; Enddo; Thanks in advance for any ideas. I'm sure it's something pretty obvious, but I'm having trouble trying to figure out what it is. Brian. -=-=-=-=-=-=-=-=-=-=-=-=-=- Brian Piotrowski Specialist - I.T. Simcoe Parts Service, Inc. Ph: 705-435-7814 x343 Fx: 705-435-6746 -=-=-=-=-=-=-=-=-=-=-=-=-=- -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.