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

From Stephan Szabo
Subject Re: Creating a boolean function
Date
Msg-id Pine.BSF.4.21.0109191233410.69032-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Creating a boolean function  (Miguel González <iafmgc@unileon.es>)
List pgsql-sql
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 identify the =$ operator and requires me to
> do the proper casting.
> 
> How can I do it? Sorry for the questions, but I am new at creating functions
> and I have to hand in this project tomorrow.

You can probably get away with just putting a space before the arguments,
so '= $1' rather than '=$1'.




pgsql-sql by date:

Previous
From: Denis Bucher
Date:
Subject: URGENT ! Nouveau virus
Next
From: "Jeff Eckermann"
Date:
Subject: Re: Creating a boolean function