Re: Functions which use an argument to decide which table to read

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Functions which use an argument to decide which table to read
Date: 2009-10-09 12:23:29
Message-ID: 20091009122329.GG19581@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2009-10-09 14:05:16 Re: Functions which use an argument to decide which table to read
Previous Message Jonathan Harden 2009-10-09 11:56:00 Functions which use an argument to decide which table to read