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

From SHARMILA JOTHIRAJAH
Subject Re: Function that returns Boolean
Date
Msg-id 330108.4204.qm@web110707.mail.gq1.yahoo.com
Whole thread Raw
In response to Function that returns Boolean  (SHARMILA JOTHIRAJAH <sharmi_jo@yahoo.com>)
List pgsql-general
Its a typo..it should be "RETURNS BOOLEAN" and not "RETURN BOOLEAN"
-Sharmila

--- On Mon, 2/23/09, SHARMILA JOTHIRAJAH <sharmi_jo@yahoo.com> wrote:

> From: SHARMILA JOTHIRAJAH <sharmi_jo@yahoo.com>
> Subject: Function that returns Boolean
> To: "General postgres mailing list" <pgsql-general@postgresql.org>
> Date: Monday, February 23, 2009, 12:39 PM
> Hi,
> This is a simple function that returns a boolean ..
>
> create or replace function check_value( newValue IN
> VARCHAR,
>                     oldValue IN VARCHAR ) RETURN BOOLEAN
> 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




pgsql-general by date:

Previous
From: SHARMILA JOTHIRAJAH
Date:
Subject: Function that returns Boolean
Next
From: Tom Lane
Date:
Subject: Re: Function that returns Boolean