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 e7S9s7L27860 for ; Mon, 28 Aug 2000 05:54:07 -0400 (EDT) Received: by vaccine.rki.de; id LAA17336; Mon, 28 Aug 2000 11:54:03 +0200 Received: from unknown(10.15.130.13) by vaccine.rki.de via smap (V5.5) id xma017334; Mon, 28 Aug 00 11:53:26 +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 QD4NBVXV; Mon, 28 Aug 2000 11:52:10 +0200 Date: Mon, 28 Aug 2000 11:53:17 +0200 (CEST) From: Andreas Tille cc: PostgreSQL SQL Subject: Re: Argument variables for select In-Reply-To: <39AA2F1C.2CCE9860@vpcit.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200008/304 On Mon, 28 Aug 2000, Yury Don wrote: > Andreas Tille wrote: > > > > 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' ; > > > AFAIK it's impossible with plpgsql, but it's possible in pltcl. Hmmm, I wonder how many languages I will learn while dealing with PostgreSQL. What about performance of pltcl compared to C. I wonder if I just do all my work using C-functions, because I know C very well and don't want to reach the next limit which I will possibly face when using pltcl. I would really like to write all my functions in SQL or PLPGSQL. If this is really impossible (I just wonder if the construct above could really not be implemented???), I would prefer C over other languages, if there are no real drawbacks. Kind regards Andreas.