> 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 typet
=?iso-8859-1?Q?Miguel_Gonz=E1lez?= <[EMAIL PROTECTED]> writes:
> But I got that the parser cannot identify the =$ operator
You need a space between = and $.
regards, tom lane
---(end of broadcast)---
TIP 2: you can get off
Maybe the reason is that you defined the function to return bool, but are
attempting to return text?
You need conditional logic, which suggests pl/pgsql is the way to go.
Something simple should do it, like:
create function check_loan (text,int,int)
returns bool
as '
begin
select * from loans whe
On Wed, 19 Sep 2001, [iso-8859-1] Miguel González wrote:
> I tried
>
> create function check_loan (text,int,int)
> returns bool
> as
> 'select CAST(typetable AS text) from loans where typetable=$1 and
> code_user=$2 and code_loan=$3;'
> language 'sql';
>
>
> But I got that the parser cannot id