From: | "Alejandro Michelin Salomon \( Adinet \)" <alejmsg(at)adinet(dot)com(dot)uy> |
---|---|
To: | "Pgsql-General" <pgsql-general(at)postgresql(dot)org> |
Subject: | Creating a function that acept any data type |
Date: | 2006-03-10 20:12:53 |
Message-ID: | !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAhx491Ki2tUS42D/aMPFg1MKAAAAQAAAAATv/A4+g6kuzRso0XKBg2wEAAAAA@adinet.com.uy |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi :
I am working in a migration. Im am migrating systems based in mysql to
postgresql.
I am trying to create a function named IFNULL, to not migrate any ocurrence
of this mysql function in my code.
The IFNULL function is the same of COALESCE in postgresql.
This code does not work.
CREATE OR REPLACE FUNCTION IFNULL( xValor ANY, xPadrao ANY )
RETURNS ANY AS $$
BEGIN
RETURN COALESCE( xValor, xPadrao );
END;
$$ LANGUAGE plpgsql
CALLED ON NULL INPUT
SECURITY INVOKER;
Can you help-me to create a function that acept any data type ?
Thank in advance
Alejandro Michelin Salomon
Porto Alegre
Brasil
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/278 - Release Date: 9/3/2006
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/278 - Release Date: 9/3/2006
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Fuhr | 2006-03-10 20:42:55 | Re: Creating a function that acept any data type |
Previous Message | Ron St-Pierre | 2006-03-10 18:45:07 | Re: Schema is Missing |