Subject RE: [firebird-support] Re: Looping a Stored Procedure - Email found in subject
Author Maya Opperman
>>I Modified the SP as suggested, but it hangs, I even added suspend for
while loop, but still hangs

WHILE (REPORTENDDATE <= ENDDATE) DO
BEGIN
FOR SELECT STARTRECEIPT,ENDRECEIPT,RECEIPTCOUNT,TAXABLESALES,
<snip>
DO
BEGIN
SUSPEND;
REPORTSTARTDATE = REPORTSTARTDATE + 1;
REPORTENDDATE = REPORTSTARTDATE + 1;
END
-- if you have no records returned by your FOR SELECT statement, your
WHILE loop will never change... hence the "hanging"
END