Functions and tablenames

From: "Julie Hunt" <jhunt(at)chac(dot)qld(dot)edu(dot)au>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Functions and tablenames
Date: 2000-04-14 06:51:04
Message-ID: 002701bfa5dd$cfc346a0$9a14a8c0@julies
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi
I would like to create a function that passes a tablename as a variable, but I do not know what 'datatype' a tablename is supposed to be.

CREATE FUNCTION find_max_id(int4, tablename?) RETURNS int4
AS 'Select max($1) FROM $2'
LANGUAGE 'sql';

When I put text as the datatype for the tablename the error was a problem near $2.
Could someone please help me.
Thanks
Julie Hunt

Browse pgsql-sql by date

  From Date Subject
Next Message Dileep Mathew 2000-04-14 09:25:56
Previous Message Jan Wieck 2000-04-14 06:44:50 Re: Function xxxx() does no exist