RE: Stored Procedre FOREACH cursor problem
Posted in 2000
Check your code for something similiar to this: FOREACH SELECT colno INTO pColNo FROM sometable; FOREACH SELECT anothercolno INTO pColNo FROM sometable WHERE colno = pColNo I came across code like this where "pColNo" was used by both the outer and inner FOREACH. Effectively, overwriting the contents of pColNo. HTH Steve Romankiw -----Original Message----- From: Roy de Silva [mailto:cheeta@idirect.com] Sent: Sunday, December 03, 2000 10:21 PM To: informix-list@iiug.org Subject: Stored Procedre FOREACH cursor problem Hi, I created a stored procedure with a FOREACH loop. The problem I' am having is that sometmes the SP will process every record in the cursor and sometimes it only process the first record and stops. I have 11 records in my test data set and it the same data set that this happens. The general syntax of my SP is as follows: FOREACH SELECT statement BEGIN perform calculations IF Condition a BEGIN call procedure 1a CONTINUE FOREACH END else IF Condition b BEGIN call procedure 2a END ELSE BEGIN call procedure 2b END END IF END IF END END FOREACH Appreciate the help. Roy