4gl - DEFINE statement w/ variable number of fields
Posted in 2000
Topics: SQL Development & Query Writing, Connectivity: ESQL/C, 4GL & Embedded SQL
Greetings, I'm trying to setup a report function in a 4gl program. However, the number of fields in the final SELECT statement vary on the basis of number of command line arguments. How can I setup a DEFINE p_some RECORD statment if the number of fields in my final output varies? Any help in this regard is greatly appreciated. Max Pyziur pyz@panix.com
Professor Bruno <pyz@panix2.panix.com> wrote in message
news:8i938t$dlh$1@news.panix.com...
>
> Greetings,
>
> I'm trying to setup a report function in a 4gl program. However,
> the number of fields in the final SELECT statement vary
> on the basis of number of command line arguments.
>
> How can I setup a DEFINE p_some RECORD statment if the
> number of fields in my final output varies?
>
You can't. The best you can do it define the record with the maximum fields
you will want, and set up your select statement to always select the same
number of columns, using nulls to fill in any you don't really need. Thus
your select statement might end up looking like:
select cola, colb, "", "", "" from ...
so in this example you select two columns and three literal nulls.
--
=======================================================
Dennis J. Pimple Informix Software, Inc.
Principal Consultant 6300 S Syracuse Way Ste 205
dennisp@informix.com Englewood CO 80111
office: 303-850-0210
direct: 303-740-5611 Opinions expressed are mine,
fax: 303-779-4025 and do not necessarily
reflect those of my employer.
http://www.informix.com
> Any help in this regard is greatly appreciated.
>
>
> Max Pyziur
> pyz@panix.com