Received: from mail.newhonest.com (vp239045.uac62.hknet.com [202.71.239.45]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAU2gXm45231 for ; Thu, 29 Nov 2001 21:42:39 -0500 (EST) (envelope-from pg@newhonest.com) Received: from jason (jason.newhonest.com [192.168.1.2]) (authenticated) by mail.newhonest.com (8.11.2/8.11.2) with ESMTP id fAU2h9c19569 for ; Fri, 30 Nov 2001 10:43:09 +0800 Message-ID: <001001c17948$c916b7c0$0201a8c0@newhonest.com> From: "Jason Kwok" To: Subject: Selecting from a dynamic name Date: Fri, 30 Nov 2001 10:43:26 +0800 Organization: New Honest Technologies Ltd MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000D_01C1798B.D7292EE0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-ECS-MailScanner: Found to be clean X-Archive-Number: 200111/428 X-Sequence-Number: 5810 This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C1798B.D7292EE0 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable 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();=20=20=20=20 pgadmin2 returns an error : ERROR : parser : parse error at or near "(" =3D=3D =3D=3D=3D=3D Best Regards Jason Kwok =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D --- Virus Free Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.303 / Virus Database: 164 - Release Date: 2001/11/24 ------=_NextPart_000_000D_01C1798B.D7292EE0 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
I have asked this question before, but still I'm=20 stuck.
How can I select from a table with a name that's return= ed by a=20 function?
 
eg : I have a function named tablename() which return= =20 '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 "("
 
=3D=3D
=3D=3D=3D=3D
Best Regards
Jason=20 Kwok
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D
 

---
Virus Free
Checked by AVG anti-virus syst= em (http://www.grisoft.com).
Version: 6.= 0.303 /=20 Virus Database: 164 - Release Date: 2001/11/24
------=_NextPart_000_000D_01C1798B.D7292EE0--