Received: from jupiter.hub.org (jupiter.hub.org [64.49.215.5]) by postgresql.org (Postfix) with ESMTP id 05D33475F9C for ; Fri, 22 Mar 2002 07:43:01 -0500 (EST) Received: (from news@localhost) by jupiter.hub.org (8.11.6/8.11.6) id g2MCW3R41973 for pgsql-sql@postgresql.org; Fri, 22 Mar 2002 06:32:03 -0600 (CST) (envelope-from news) From: "Ivan Babikov" X-Newsgroups: comp.databases.postgresql.sql Subject: How to return more than one variable from PgPlSQL procedure? Date: Fri, 22 Mar 2002 17:34:05 +0500 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 23 Message-ID: Reply-To: "Ivan Babikov" X-Complaints-To: news@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 To: pgsql-sql@postgresql.org X-Archive-Number: 200203/287 X-Sequence-Number: 7166 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.