Re: Creating a boolean function - Mailing list pgsql-sql

From Kovacs Baldvin
Subject Re: Creating a boolean function
Date
Msg-id Pine.GSO.4.33.0109192359180.6780-100000@ural2
Whole thread Raw
In response to Re: Creating a boolean function  ("Jeff Eckermann" <jeckermann@verio.net>)
List 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



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Creating a boolean function
Next
From: clayton cottingham
Date:
Subject: Re: Holiday Calculations?