Column names returned by a SPL
Posted in 2000
Topics: Stored Procedures & SPL, Data Types & Schema Design, Jobs, Consulting & Announcements
Hy,
Is it possible to assign column names to the resultset of a SPL ?
eg.
CREATE FUNCTION FuncColumnName()
returning VARCHAR(255);
DEFINE _tabname VARCHAR(255);
FOREACH
SELECT tabname
INTO _tabname
FROM systables
RETURN _tabname WITH RESUME;
END FOREACH;
END FUNCTION;
--------------------
EXECUTE PROCEDURE FuncColumnName();
The name of the result column is (expression) !!! Can I assign an other
column name ??
Regards,
Stefan
Stefan -
I've complained about this to Informix for many years. They don't seem to
particularly care, in the same way dbload can't handle a simple comma-quote
delimited file or dbaccess seems written by a college intern in 1983. The
short answer: no, you can't do this, at least in a 7.x stored procedure.
It seems like you're using 9.x, however - I'm not familiar with that
version.
Rich
Stefan Moens wrote:
> Hy,
>
> Is it possible to assign column names to the resultset of a SPL ?
>
> eg.
>
> CREATE FUNCTION FuncColumnName()
> returning VARCHAR(255);>
> DEFINE _tabname VARCHAR(255);
>
> FOREACH
> SELECT tabname
> INTO _tabname
> FROM systables>
> RETURN _tabname WITH RESUME;
>
> END FOREACH;
>
> END FUNCTION;
>
> --------------------
>
> EXECUTE PROCEDURE FuncColumnName();>
> The name of the result column is (expression) !!! Can I assign an other
> column name ??
>
> Regards,
> Stefan
--
Richard C. Auslander
Database Manager
AirFlash, Inc.
1733 Woodside Rd., Suite #110
Redwood City, CA 94061
(650) 556-7928
www.airflash.com