Table as parameter in function - Mailing list pgsql-general

From Kaare Rasmussen
Subject Table as parameter in function
Date
Msg-id 199903092047.VAA03405@bohr.webline.dk
Whole thread Raw
In response to Re: [GENERAL] Calcuate percentage.  (Sze Yuen Wong <swong_@yahoo.com>)
List 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?


pgsql-general by date:

Previous
From: Naceur
Date:
Subject: Postgres tutorial examples !
Next
From: Kaare Rasmussen
Date:
Subject: Re: [GENERAL] Calcuate percentage.