[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Repetitive updates on an SQL routine inside a SQR



Title: RE: Repetitive updates on an SQL routine inside a SQR

Have you confirmed that WCM.IDNUMBER has multiple rows?  Your code will update only those rows that match &IDNUMBER.

Also, what is your database flavor?  Oracle, I believe, closes all SELECTS when a COMMIT is done (such as in this statement).  If that's the case, then you need to do something like build a list of &IDNUMBERs, then do this SQL where WCM.IDNUMBER IN (list).

Bob

-----Original Message-----
From: Chuck.L.King@SEALEDAIR.COM [mailto:Chuck.L.King@SEALEDAIR.COM]
Sent: Friday, March 03, 2000 3:59 PM
To: SQR-USERS@list.iex.net
Subject: Repetitive updates on an SQL routine inside a SQR


I have a report that when run will print out the needed information but also
uses an SQL routine to update a column with a 'Y' in the table.  This works fine
when one record is selected, but when printing multiple records only the first
record in the queue is being updated.  The code snippet is below.  Any ideas how
I can make it update all queued records that are being printed?

BEGIN-PROCEDURE UPDATE_PRINTED_FIELD
BEGIN-SQL
UPDATE WCM SET WCM.XTRA33 = 'Y' WHERE WCM.IDNUMBER = &IDNUMBER;
END-SQL
COMMIT
END-PROCEDURE