Table as parameter in function

From: Kaare Rasmussen <kar(at)webline(dot)dk>
To: pgsql-general(at)hub(dot)org
Subject: Table as parameter in function
Date: 1999-03-09 20:47:42
Message-ID: 199903092047.VAA03405@bohr.webline.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

As I tried to make a function for this percent calculation I fell over
the problem of passing a table to the function. I'd like to make this
function:

create function NumRows(table) returns int4
as 'select count(*) from $1'
language 'sql';

Is this possible?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Naceur 1999-03-09 21:21:05 Postgres tutorial examples !
Previous Message Kaare Rasmussen 1999-03-09 20:42:33 Re: [GENERAL] Calcuate percentage.