How to return more than one variable from PgPlSQL procedure?

From: "Ivan Babikov" <iab(at)qms(dot)e-burg(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: How to return more than one variable from PgPlSQL procedure?
Date: 2002-03-22 12:34:05
Message-ID: a7f882$18v8$1@jupiter.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello all,

I've noticed that postgres functions can return SETOF but it seems that
SETOF works only for sql-language functions. At least the code below is
compilable but causes freezing of pgAdmin during the execution. This
function was converted to PgPlSql from Interbase:

***************************************
CREATE FUNCTION "copy_node_sp_data"("int4", "int4") RETURNS SETOF sp_data AS
'
DECLARE INT_ID ALIAS FOR $1;
DECLARE NEW_PARENT ALIAS FOR $2;
DECLARE r RECORD;
BEGIN
Select into r * from SP_DATA where ID=1;
return r;
END;
***************************************

Actually, all I need is to return some integers.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Pirtea Calin 2002-03-22 14:37:31 Re: Yet another indexing issue.
Previous Message Martín Marqués 2002-03-22 11:18:23 Re: Migrating a MySQL schema with an enum