Column name from a stored procedure
Posted in 2000
Topics: SQL Development & Query Writing, Stored Procedures & SPL, Clustering, Grid & MACH11
Does anyone know if I can name columns returned from a stored procedure?
For example, the simple select statement:
SELECT a AS Col1, b AS Col2 ...Names the first column Col1 and the second Col2.
If I make a stored procedure that returns 2 columns is it possible to name
them somehow? The default name seems to be (expression) and even putting in
the AS clause in the select in the stored procedure does not seem to make
any difference.
(The reason for the names is that we have some Visual Basic controls which
rely on the name being present so it can display it in the column header in
the data grid.)
-----------
Luke
Luke -
This is an old complaint going back years, and Informix seems unwilling to fix
it, no matter how many times we ask. So sorry, no ... this can't be done. Of
course some sort of trick (I'm thinking out loud) might be possible, such as
writing the results into a temp table or even a permanent unlogged table
qualified by some kind of unique key, such as a requestID or something along
those lines. Just a thought ...
Rich
Luke McFarlane wrote:
> Does anyone know if I can name columns returned from a stored procedure?
>
> For example, the simple select statement:
> SELECT a AS Col1, b AS Col2 ...> Names the first column Col1 and the second Col2.
> If I make a stored procedure that returns 2 columns is it possible to name
> them somehow? The default name seems to be (expression) and even putting in
> the AS clause in the select in the stored procedure does not seem to make
> any difference.
>
> (The reason for the names is that we have some Visual Basic controls which
> rely on the name being present so it can display it in the column header in
> the data grid.)
> -----------
> Luke
--
Richard C. Auslander
Manager of Database Services
AirFlash, Inc.
1733 Woodside Rd., Suite #110
Redwood City, CA 94061
(650) 556-7928
www.airflash.com