Argument variables for select - Mailing list pgsql-sql

From Andreas Tille
Subject Argument variables for select
Date
Msg-id Pine.LNX.4.21.0008280957530.30760-100000@wr-linux02.rki.de
Whole thread Raw
List pgsql-sql
Hello,

I want to use the following construct in a stored function:

Create Function VarSelect ( varchar, varchar )  returns int  As '    Declare num int ;        Begin      Select Into
numCount(*) From $1 Where $2 ;      return num;    End ;  ' language 'plpgsql' ;
 

Could someone please explain who to type the exact syntax so that
I can ship the table to select from as $1 and the condition to select
what as $2?  Or do I have to concatenate a string with the whole
select statement and how to call this string?  In MS SQL server this
could be done with   Exec ( query )

Kind regards
         Andreas.



pgsql-sql by date:

Previous
From: Alessandro Valenti
Date:
Subject: Tutorial
Next
From: pierre@kahuna.versions.com
Date:
Subject: shared memory leak in 7.0.2?