Thread: Functions: passing table names as parameters

Functions: passing table names as parameters

From
gianpaolo
Date:
Hi,
I have three or four simple functions that do the same things on different
table. I would want to create only one function that receive as parameter the
name of the table on which operate.
i.e.

CREATE FUNCTION nid() RETURNS int4
        as 'SELECT id from objcat_id where flag=0'
        LANGUAGE 'sql';
I din't succeed in passing the table name as parameter.
Any suggestion?

    thank in advance,
    gianpaolo
--
gianpaolo racca
gianpaolo@preciso.net
http://www.preciso.net