Re: Selecting from a dynamic name - Mailing list pgsql-sql

From Christopher Kings-Lynne
Subject Re: Selecting from a dynamic name
Date
Msg-id GNELIHDDFBOCMGBFGEFOAEKDCAAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Selecting from a dynamic name  ("Jason Kwok" <pg@newhonest.com>)
List pgsql-sql
You could try writing another function to do the select, and construct the query using string manipulation...
 
Chris
-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Jason Kwok
Sent: Friday, 30 November 2001 10:43 AM
To: pgsql-sql@postgresql.org
Subject: [SQL] Selecting from a dynamic name

I have asked this question before, but still I'm stuck.
How can I select from a table with a name that's returned by a function?
 
eg : I have a function named tablename() which return 'mytable'
If I already have a table called mytable, can I :
 
select * from tablename();   
 
pgadmin2 returns an error :
ERROR : parser : parse error at or near "("
 
==
====
Best Regards
Jason Kwok
==============
====
 

---
Virus Free
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.303 / Virus Database: 164 - Release Date: 2001/11/24

pgsql-sql by date:

Previous
From: "Jason Kwok"
Date:
Subject: Selecting from a dynamic name
Next
From: Markus Bertheau
Date:
Subject: Re: contracting tables