Re: Q: Assigning names to values returned from SP
Posted in 1997
Joe Lumbley wrote:
>
> Edwin Babadaglian (edwinb@panix.com) wrote:
> : I am writing a Java applet that executes a stored procedure that
> : returns rows. I would like to use names rather that indexes to refer
> : to a column. If I execute the procedure from dbaccess, I get all
> : columns labeled '(expression)'. I've tried using the 'AS' keyword in
> : the return statement's column list but that's a syntax error.
>
> Try:
>
> SELECT integer1*integer2 product_of_integers
> FROM yourtable
> WHERE whatever_you_want;
>
> The number integer1*integer2 will be called "product_of_integers"
> Note that there is no comma between integer2 and product_of_integers.
Joe,
unfortunately, this does not help for assigning a column label to the
values returned from a SP. If I say "EXECUTE PROCEDURE yada" and it
returns a row of 5 values, the column label for all column will always
be (expression) - all 5 times. Knowing enough of dynamic SQL to
understand how dbaccess gets label headings, I can be fairly certain
that the SQLDA (or SQL descriptor if you like strait-jackets, but that's
another issue) entry also contains this string.
I entered a feature request for this years ago (Jonathan can probably
dig up the entry in FRDB). I had even bigger goals: I wanted to be able
to create a view as an "execute procedure" statement.
I don't have the time for a political commentary but I'm not holding my
breath for this one.
--
-- Jake (In pursuit of undomesticated aquatic avians)
+----------------------------------------------------------------------+
|Insofar as manifestations of functional deficiencies are agreed by any|
|and all concerned parties to be imperceivable, and are so stipulated, |
|it is incumbent upon said heretofore mentioned parties to exercise the|
|deferment of otherwise pertinent maintenance procedures. |
+------------------------ A Legal Minded Engineer (hardyharhar.com) ---+