pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedSelecting from a dynamic name
2+ messages / 2 participants
[nested] [flat]
* Selecting from a dynamic name
@ 2001-11-30 02:43 Jason Kwok <pg@newhonest.com>
2001-11-30 03:37 ` Re: Selecting from a dynamic name Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 1 reply; 2+ messages in thread
From: Jason Kwok @ 2001-11-30 02:43 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Selecting from a dynamic name
2001-11-30 02:43 Selecting from a dynamic name Jason Kwok <pg@newhonest.com>
@ 2001-11-30 03:37 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Kings-Lynne @ 2001-11-30 03:37 UTC (permalink / raw)
To: Jason Kwok <pg@newhonest.com>; 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-11-30 03:37 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-30 02:43 Selecting from a dynamic name Jason Kwok <pg@newhonest.com>
2001-11-30 03:37 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox