Re: select from a dynamic table name

From: David Stanaway <david(at)netventures(dot)com(dot)au>
To: <pgsql-sql(at)postgresql(dot)org>
Cc: "Jason Kwok" <jason(at)newhonest(dot)com>
Subject: Re: select from a dynamic table name
Date: 2001-11-05 23:07:50
Message-ID: EF404437-D241-11D5-AF6A-0003930FDAB2@netventures.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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 <JanWieck(at)Yahoo(dot)com> 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(at)stanaway(dot)net
Work: david(at)netventures(dot)com(dot)au

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Kings-Lynne 2001-11-06 02:24:00 Re: Porting Web application written in Oracle 8 PL/SQL to Postgresql
Previous Message X 2001-11-05 18:13:15 copy command with PSQL