Subject Re: [ib-support] Stored Proc Question
Author Robert F. Tulloch
Hi:

Well, I get it to Prepare in IBConsole: Question is will something
like this work?

SET TERM ## ;
CREATE PROCEDURE UPDATEZORRO (DATE1 DATE, PARAM1 INTEGER, YEAR1
INTEGER,
PARAM2 INTEGER, PARAM3 INTEGER, PARAM4 INTEGER, PARAM5 INTEGER, PARAM6
INTEGER)
AS
DECLARE VARIABLE RdID INTEGER;
BEGIN
FOR SELECT ID
FROM MEMBERS
WHERE STATUS_MEM = 'ACTIVE'
INTO RdID
DO
UPDATE MEMPAY2
SET RENEW_DUES = :PARAM1
WHERE (ID = :RdID AND RENEW_DATE >= :DATE1 AND
YEARM2 >= :YEAR1 AND
RENEW_DUES = :PARAM2);

UPDATE MEMPAY2
SET RENEW_DUES = :PARAM3
WHERE (ID = :RdID AND RENEW_DATE >= :DATE1 AND
YEARM2 >= :YEAR1 AND
RENEW_DUES = :PARAM4);

UPDATE MEMPAY2
SET RENEW_DUES = :PARAM5
WHERE (ID = :RdID AND RENEW_DATE >= :DATE1 AND
YEARM2 >= :YEAR1 AND
RENEW_DUES = :PARAM6);


END ##
SET TERM ; ##