Skip site navigation (1) Skip section navigation (2)

Re: Argument variables for select

From: Andreas Tille <tillea(at)rki(dot)de>
Cc: PostgreSQL SQL <pgsql-sql(at)hub(dot)org>
Subject: Re: Argument variables for select
Date: 2000-08-28 09:53:17
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
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


In response to

pgsql-sql by date

Next:From: Sherwin DaganatoDate: 2000-08-28 11:13:27
Subject: better way
Previous:From: Yury DonDate: 2000-08-28 09:21:32
Subject: Re: Argument variables for select

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group