agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: beyaRecords - The home Urban music <uzo@beya-records.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Stored procedures
Date: Thu, 01 Jan 2004 21:10:21 -0500
Message-ID: <2409.1073009421@sss.pgh.pa.us> (raw)
In-Reply-To: <08C87AE5-3CC6-11D8-AB42-0003938366A4@beya-records.com>
References: <08C87AE5-3CC6-11D8-AB42-0003938366A4@beya-records.com>

beyaRecords - The home Urban music <uzo@beya-records.com> writes:
> I am having problems with a stored procedure (plpgsql) that takes in a
> value and returns a record set.
> I am calling the procedure as follows:
> select clientRec('tmpg60');

Use 

	select * from clientRec('tmpg60') as (column list);

If you declare the function as returning RECORD, you will need to
provide an AS clause that identifies the column set the records will
contain.  Without this, the parser has no idea what to expand "*" to.
See the example in section 7.2.1.4 here:
http://www.postgresql.org/docs/7.4/static/queries-table-expressions.html

			regards, tom lane



view thread (23+ messages)  latest in thread

Message-ID: <2409.1073009421@sss.pgh.pa.us>
Permalink:  ../2409.1073009421@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2409.1073009421@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, uzo@beya-records.com
  Subject: Re: Stored procedures
  In-Reply-To: <2409.1073009421@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox