Re: Informix Bug or valid SQL?
Posted in 1997
In article
<F864DE74D8BA7496.A2FA9D0129784396.6E63C022CEF26BE6@library-proxy.airnews.net>
,
Daniel Wright <danwright@bigfoot.com> wrote:
>I believe this is an Informix bug, especially since older versions used
>to give an SQL error when you Declared a cursor selecting X columns, but
>used a fetch with Y columns (where X != Y).
This gives an SQL WARNING. The default action under a warn condition is
to CONTINUE. You can stop this by issuing a WHENEVER WARNING STOP
statement.
We actually use this 'feature' quite often in programs (usually reports)
when, for example, the sort column is not required for further processing.
declare narr_curs cursor for
select cn_narration, cn_rowno...
order by cn_rowno
foreach narr_curs into l_narration
..
cn_narration is to be printed but should be in cn_rowno order.
cn_rowno has to be among the columns selected as we are ordering
by it. However, it is not retrieved into a program variable
because its purpose ends with the select stmt.
HTH.
-----------------------
Rudy Fernandes
GIC, Kuwait
OL 7.20UC4, 4GL 6.04UC1
-----------------------