Re: Function that returns Boolean - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Function that returns Boolean
Date
Msg-id 230068862.1353591235411818515.JavaMail.root@sz0030a.emeryville.ca.mail.comcast.net
Whole thread Raw
In response to Function that returns Boolean  (SHARMILA JOTHIRAJAH <sharmi_jo@yahoo.com>)
List pgsql-general

----- "SHARMILA JOTHIRAJAH" <sharmi_jo@yahoo.com> wrote:

> Hi,
> This is a simple function that returns a boolean ..
>
> create or replace function check_value( newValue IN VARCHAR,
>                     oldValue IN VARCHAR ) RETURN BOOLEAN
                                            ^^^^^^ RETURNS
> as
> '
> BEGIN
>     IF ( newValue != oldValue)
>         then return true;
>     else
>         return false;
>      END IF;
> END;
> '
> LANGUAGE 'plpgsql'
>
> But I get this error...what is wrong with this ?
>
> [Error] Script lines: 1-13 -------------------------
>  ERROR: syntax error at or near "RETURN"
>  Line: 2
>
> Thanks
> Sharmila
>
>
Adrian Klaver
aklaver@comcast.net

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Function that returns Boolean
Next
From: Keaton Adams
Date:
Subject: Product Roadmap question and request for recommendation