Re: Function that returns Boolean

From: SHARMILA JOTHIRAJAH <sharmi_jo(at)yahoo(dot)com>
To: General postgres mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Function that returns Boolean
Date: 2009-02-23 17:43:23
Message-ID: 330108.4204.qm@web110707.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Its a typo..it should be "RETURNS BOOLEAN" and not "RETURN BOOLEAN"
-Sharmila

--- On Mon, 2/23/09, SHARMILA JOTHIRAJAH <sharmi_jo(at)yahoo(dot)com> wrote:

> From: SHARMILA JOTHIRAJAH <sharmi_jo(at)yahoo(dot)com>
> Subject: Function that returns Boolean
> To: "General postgres mailing list" <pgsql-general(at)postgresql(dot)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

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-02-23 17:49:00 Re: Function that returns Boolean
Previous Message SHARMILA JOTHIRAJAH 2009-02-23 17:39:01 Function that returns Boolean