Re: Stored Procedure / ESQL/C question
Posted in 1994
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Jim Gordon (jgordon@ssf-sys.dhl.com) wrote:
: > Is there any way to make an esql/c program return the column name for
: > the selected data in the name field of the sqlda structure? I see that
: > any time I execute a stored procedure which returns back data after a select,
: > the content of the name field is always "<expression>" and not the actual
: > column name for that corrosponding data.
: > I would be really interested in knowing if I could access this information
: > after executing a stored proc.
: > Thanks much,
: > Govind
: >
: Currently no. This is partly due to the fact that the engine doesn't
: really know which attribute in the database a return field from a
: stored procedure contains. In fact it may not relate to any attribute
: in the database but may be generated by the stored procedure. I do
: agree though that passing back <expression> is not very helpfull. I
: would like it to return the name used to describe the field in the
: return statement. A number of new capabilities have been added in V6
: but I don't know whether this is one of them. Could someone at
: Informix enlighten us?
: Cheers - Jim
: My opinions are my own. They may vary with time but they remain MINE!
: ----------------------------------------------------------------------
: Name: Jim Gordon Internet: jgordon@ssf-sys.DHL.COM
: Company: DHL Systems Inc Phone: (415) 375-5222 (Work)
: Address: 700 Airport Blvd. #300 (415) 775-7762 (Home)
: Burlingame, CA 94010-1937 Fax: (415) 375-5019
: ----------------------------------------------------------------------
Couldn't you put an alias name in the select clause after the expression.
For example:
SELECT a, b+c d FROM table1;
returns
a d
data data
I tried this out with my esql interface and it worked. Of course, this
might not work for your particular application.
Good luck!
Kristen
--
And now, Ladieeees and Gentlemen, stand and cheeer yourrrr Orlannndo Magic!!
+---------------------------------------------------------------------------+
| Kristen Altman | Go Magic! | The only reason to work is |
| kma@ccd.harris.com | WAR EAGLE! | to finance vacations and |
| Harris Controls Division | | retirement! |
| Melbourne, FL | | |
+---------------------------------------------------------------------------+