Re: Re: Argument variables for select

From: Webb Sprague <wsprague100(at)yahoo(dot)com>
To: Andreas Tille <tillea(at)rki(dot)de>
Cc: PostgreSQL SQL <pgsql-sql(at)hub(dot)org>
Subject: Re: Re: Argument variables for select
Date: 2000-08-29 15:36:10
Message-ID: 20000829153610.29983.qmail@web803.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I think you have to run "createlang pltcl db-foo"
from the command line.

As for your boss, here are three things I can think of
off the top of my head:

1. All new products take some time to learn. If you
can't use Postgres perfectly in a week or so, remember
that you probably can't learn to be an Oracle or
MS-SQL DBA in a week or so either.

2. Postgres is FREE. NO MONEY.

3. Postgres integrates very easily into a Unix
environment.

4. Proprietary software is going the way of the
Do-Do.

Well that's four. At my job, we are building a
database in Postgres to replace an MS-SQL thing. My
version takes 12 hours to upload a months worth of
data. You think that is bad--the SQL Server took 15
DAYS.

Good luck, and sorry for the rant.
W
--- Andreas Tille <tillea(at)rki(dot)de> wrote:
> On Mon, 28 Aug 2000, Yury Don 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' ;
> > >
> > > 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 )
> > >
> > AFAIK it's impossible with plpgsql, but it's
> possible in pltcl.
>
> It is really hard to believe that I'm in so very
> deep trouble with
> PostgreSQL. It seems to me that stored procedures
> are far from beeing
> as usefull as I learned them to know in MS SQL
> server. Once I try
> to follow one hint I'm standing in frot of the next
> even harder problem.
>
>
> web=# create function testfunc( )
> web-# returns int
> web-# As '
> web'# spi_exec "SELECT count(*) AS $num FROM
> testtable"
> web'#
> web'# return $num ;
> web'# End; '
> web-# language 'pltcl' ;
> ERROR: Unrecognized language specified in a CREATE
> FUNCTION: 'pltcl'. Recognized languages are sql, C,
> internal and the created procedural languages.
>
>
> I have installed the pgtcl package of my Debian
> distribution, so I guess
> it should be available. Once more the question: Is
> it really necessary to
> use a further interpreter instead of sticking with
> SQL commands to use
> the original problem.
>
> I have to admit that my boss wonders why I'm
> switching from a working
> solution (MS SQL) to so much trouble :-(. I really
> hope to convince him
> to OpenSource but it's much harder than I expected.
>
> Kind regards
>
> Andreas.
>

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

Browse pgsql-sql by date

  From Date Subject
Next Message J. Fernando Moyano 2000-08-29 22:46:18 Problems with complex queries ...
Previous Message Stuart Foster 2000-08-29 15:32:49 Viewing a function