Variable Substitution for table name

From: "Samuel J(dot) Sutjiono" <ssutjiono(at)wc-group(dot)com>
To: <pgsql-general(at)postgresql(dot)org>, <pgsql-sql(at)postgresql(dot)org>
Subject: Variable Substitution for table name
Date: 2002-03-16 21:52:54
Message-ID: 00e901c1cd34$edd88cb0$110a010a@headquarters.wcgroup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Hello all,

Does anybody know whether I can do variable substitution in PostgreSQL function ???

create function Test(text) returns text as '
DECLARE
NewView ALIAS for $1;

BEGIN

For rec_set IN SELECT DeptdID, VendorName
from NewView where (DeptID = iDeptID)

I appreciate any help very much.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-03-16 23:01:52 Re: problem with array of boxes
Previous Message Tom Lane 2002-03-16 20:58:35 Re: How to get the name of a table's primary key?

Browse pgsql-sql by date

  From Date Subject
Next Message Dan Langille 2002-03-16 22:07:49 why the big difference on this explain analyze?
Previous Message george young 2002-03-16 18:28:00 hashtext function disappears in 7.2?