Re: Passing a table name to a function for dynamic queries.... - Mailing list pgsql-general

From Richard Huxton
Subject Re: Passing a table name to a function for dynamic queries....
Date
Msg-id 42C2EA5B.6050804@archonet.com
Whole thread Raw
In response to Passing a table name to a function for dynamic queries....  ("Greg Patnude" <gpatnude@hotmail.com>)
List pgsql-general
Greg Patnude wrote:
> I know I've seen the answer to this here before but cannot seem to find
> it....  Can anyone give me the quick & dirty answer to passing a table name
> to a function like this:
>
> CREATE OR REPLACE FUNCTION tbl_toarray(name) RETURNS text

Build the query as text and use EXECUTE to run it.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Devrim GUNDUZ
Date:
Subject: Re: CVS Build - No Doc
Next
From: Scott Marlowe
Date:
Subject: Re: Need help writing SQL statement