Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B13DB37C1AC for ; Thu, 9 Oct 2008 13:08:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 08671-03 for ; Thu, 9 Oct 2008 13:08:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6376937C34C for ; Thu, 9 Oct 2008 13:08:09 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m99G87SD016880; Thu, 9 Oct 2008 12:08:07 -0400 (EDT) To: cyw@dls.net cc: pgsql-general@postgresql.org Subject: Re: PLSQL function calling another function In-reply-to: <092C17F5803E42FCAFD8D3A43A2E5A12@nc05072019> References: <092C17F5803E42FCAFD8D3A43A2E5A12@nc05072019> Comments: In-reply-to message dated "Thu, 09 Oct 2008 09:26:11 -0500" Date: Thu, 09 Oct 2008 12:08:07 -0400 Message-ID: <16879.1223568487@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/324 X-Sequence-Number: 138574 writes: > I am trying to figure out how to call one PLSQL function from another, specifically how to access the return values from the callee. > I made two test functions, A and B. A calls B. > B returns two values: > OUT tid integer > OUT msg character varying > In caller function A, I do the following: > SELECT B(1) INTO rec; -- rec declared as a RECORD This produces a record containing a single composite column (named "b"), as you would see if you did the same SELECT by hand: regression=# select b(1); b ----------- (100,MSG) (1 row) You will get the results you expect if you do something like select * into rec from b(1); regards, tom lane