Re: [SQL] Help in stored procedure

2004-11-05 Thread Thomas F.O'Connell
I think you want to be using SELECT INTO rather than assignment for your queries. See http://www.postgresql.org/docs/7.4/static/plpgsql- statements.html#PLPGSQL-STATEMENTS-ASSIGNMENT http://www.postgresql.org/docs/7.4/static/plpgsql- statements.html#PLPGSQL-SELECT-INTO The expression part of

[SQL] Help in stored procedure

2004-11-05 Thread Igor Maciel Macaubas
Hi Guys,   I need some help on building the following stored procedure, in PL/PgSQL. If this is not the right place to ask for help in this language, please let me know. Here is what I want to do, my comments in red:   CREATE OR REPLACE FUNCTION discover_nsu(integer) RETURNS integer as 'DECL