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'.