Re: Creating a boolean function

From: Kovacs Baldvin <kb136(at)hszk(dot)bme(dot)hu>
To: Jeff Eckermann <jeckermann(at)verio(dot)net>
Cc: Miguel González <iafmgc(at)unileon(dot)es>, PostgreSQL SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Creating a boolean function
Date: 2001-09-19 22:03:51
Message-ID: Pine.GSO.4.33.0109192359180.6780-100000@ural2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> You need conditional logic, which suggests pl/pgsql is the way to go.

Maybe he could use simple sql function like this:

create function check_loan(text,int,int) returns boolean as '
select (
select count(*) from kolcsonok where
code_user=($2) and code_loan=($3) and typetable=($1)
) > 0;
' language 'sql';

The immediate benefit of it is that there's no need to install
a procedural languge for this simple task.

Regards,
Baldvin

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message clayton cottingham 2001-09-19 22:39:23 Re: Holiday Calculations?
Previous Message clayton cottingham 2001-09-19 21:49:23 Re: Holiday Calculations?