Search Postgresql Archives

Creating a function that acept any data type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux