Re: Foreach statement
Posted in 1997
Jim, since the FOREACH is [allegedly] the equivalant of an OPEN, the FOREACH should be close the cursor and reopen it, just as an explicit OPEN would do. You are correct; the FOREACH has been behaving this way. However, this is incorrect behavior for the FOREACH. I found this code all over the place at my place and was quite annoyed at this abuse of what is really a bug (IMO). I reported it to Informix as such. One of these days, some well-meaning purist will fix this bug (I wonder if this works in ESQL also) and break an awful lotta code out there. Then I'll be gloating: "See? I told you so!" ;-) Jim Young wrote: > > Undocumented feature: > > For the older versions, you can do an open using statement, then do > your foreach statement without a using clause - it works just like > you had a using clause on the foreach. > > Denis Cloutier wrote: > > > Hello, > > I was at the Informix > > conference a couple of weeks ago > > and went to the 4gl-Tips and > > Tricks track. At that seminar, I > > could swear I heard someone > > mention that a "using" clause > > could be used with a foreach > > statement now. Is this true? > > > > Thanks in advance, > > Denis J. Cloutier > > Systems Analyst/Programmer > > Yankee Candle Company -- -- Jake (In pursuit of undomesticated aquatic avians) +----------------------------------------------------------+ | Inscription on the headstone of a hypocondriac: SEE? | +----------------------------------------------------------+