Function that returns Boolean - Mailing list pgsql-general

From SHARMILA JOTHIRAJAH
Subject Function that returns Boolean
Date
Msg-id 156905.9409.qm@web110714.mail.gq1.yahoo.com
Whole thread Raw
Responses Re: Function that returns Boolean
Re: Function that returns Boolean
Re: Function that returns Boolean
Re: Function that returns Boolean
List pgsql-general
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: Angelo Astorga
Date:
Subject: Serverlog postgresql 8.1.11
Next
From: SHARMILA JOTHIRAJAH
Date:
Subject: Re: Function that returns Boolean