Hi

Is there a standard postgres method of replacing empty strings.

In Oracle, nvl handles nulls and empty strings, as does ifnull() in
MySQL, but with postgres coalesce only handles null strings.

If, not is the best solution to create a plpgsql function, ie

CREATE FUNCTION isEmpty (character varying, character varying) RETURNS
character varying
    AS '
declare
    fnRetTrue  alias for $1;
    fnRetFalse alias for $2;
begin
    if fnRetTrue = '' or fnRetTrue is not null then
        return fnRetTrue;
    else
        return fnRetFalse;
    end if;
end;
'
    LANGUAGE plpgsql;

Thanks

Simon

-- 
Simon Windsor
Email: [EMAIL PROTECTED]
Tel: 01454 617689
Mob: 07960 321599


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Mailscanner thanks transtec Computers for their support.


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to