Re: Creating a boolean function

Поиск
Список
Период
Сортировка
От Kovacs Baldvin
Тема Re: Creating a boolean function
Дата
Msg-id Pine.GSO.4.33.0109192359180.6780-100000@ural2
обсуждение исходный текст
Ответ на Re: Creating a boolean function  ("Jeff Eckermann" <jeckermann@verio.net>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Creating a boolean function
Следующее
От: clayton cottingham
Дата:
Сообщение: Re: Holiday Calculations?