On 04/01/2014 06:44 PM, Bui, Michelle P wrote:
v_status is not used inthe SQL statement but is used in the function because we need to return a table (catgory, tool_count, status).
Even when I did not use v_status, and assign value 'valid' or 'invalid' to the output parameter directly, the same error occurred.
Not use v_status where, in the DECLARE block or as an alias in the query?
If it where me and I wanted to keep the variable in the DECLARE block I
would do:
DECLARE
_v_status TEXT;
At least you would be able to track which variable is in play.
> Can we assign value for an alias in a function?
An SQL alias for table, column, etc or an alias for a function argument?
http://www.postgresql.org/docs/9.3/interactive/plpgsql-declarations.html#PLPGSQL-DECLARATION-ALIAS
Thanks,
Michelle
--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general