Received: from vaccine.rki.de (firewall-user@vaccine.rki.de [193.175.81.250]) by hub.org (8.10.1/8.10.1) with SMTP id e7S871L96195 for ; Mon, 28 Aug 2000 04:07:02 -0400 (EDT) Received: by vaccine.rki.de; id KAA16373; Mon, 28 Aug 2000 10:06:58 +0200 Received: from unknown(10.15.130.13) by vaccine.rki.de via smap (V5.5) id xma016364; Mon, 28 Aug 00 10:06:21 +0200 Received: from wr-linux02.rki.de ([10.15.140.59]) by mailnu01.rki.de with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id QD4NBVXL; Mon, 28 Aug 2000 10:05:04 +0200 Date: Mon, 28 Aug 2000 10:06:13 +0200 (CEST) From: Andreas Tille To: PostgreSQL SQL Subject: Argument variables for select Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200008/301 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 num Count(*) 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.