Received: from mta01ps.bigpond.com (mta01ps.bigpond.com [144.135.25.133]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fA5N7rq80431 for ; Mon, 5 Nov 2001 18:07:54 -0500 (EST) (envelope-from david@netventures.com.au) Received: from ciderbox.in.netventures.com.au ([144.135.25.75]) by mta01ps.bigpond.com (Netscape Messaging Server 4.15) with SMTP id GMCOK100.EZG; Tue, 6 Nov 2001 09:14:25 +1000 Received: from BPH-D2-p-239-223.tmns.net.au ([144.134.239.223]) by PSMAM03.mailsvc.email.bigpond.com(MailRouter V2.9k 8392/4067038); 06 Nov 2001 09:07:52 Date: Tue, 6 Nov 2001 10:07:50 +1100 Subject: Re: select from a dynamic table name Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v472) Cc: "Jason Kwok" To: From: David Stanaway In-Reply-To: <000e01c1636b$c466b380$0201a8c0@newhonest.com> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.472) X-Archive-Number: 200111/61 X-Sequence-Number: 5445 On Friday, November 2, 2001, at 05:58 PM, Jason Kwok wrote: > Since I could return a rowset (some records) from a function of pgsql or > plpgsql, I saved all the records into a temp file. Then I want to get > the > rowset by another select statement from this temp table with dynamic > name, > could I do something like the folowing : > > select * from a_dynamic_table_name ? How about exec 'select * from '&somefunc(); Where somefunc() returns the name of the temporary table. You'll have to delete it after, so it will be a little more messy. There was talk in the list on functions returning record sets being a feature of 7.2 and there being some patches for 7.1 that permited it. Jan Wieck Wrote on Wed Aug 15, 2001 03:49:03 PM Australia/Sydney > As said, in v7.2 we'll have the ability to return cursors > from functions (and I'm looking actually into the ability of > doing RETURN AND RESUME). So there is at least some sort of > workaround on the horizon. ============================== David Stanaway Personal: david@stanaway.net Work: david@netventures.com.au