Re: Functions which use an argument to decide which table to read - Mailing list pgsql-novice

From A. Kretschmer
Subject Re: Functions which use an argument to decide which table to read
Date
Msg-id 20091009122329.GG19581@a-kretschmer.de
Whole thread Raw
In response to Functions which use an argument to decide which table to read  ("Jonathan Harden" <jonathan.harden@zeninternet.co.uk>)
List pgsql-novice
In response to Jonathan Harden :
> Hello,
>
>
>
> I am trying to write a function which takes an argument and uses that argument
> to return a set of rows from a table with the name given (or possibly inferred)
> from the argument.

You have to use EXECUTE. Build a string that contains your select, and
execute that string.

Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)

pgsql-novice by date:

Previous
From: "Jonathan Harden"
Date:
Subject: Functions which use an argument to decide which table to read
Next
From: Tom Lane
Date:
Subject: Re: Functions which use an argument to decide which table to read