On Wednesday 27 August 2003 09:58, Christian Traber wrote:
> Hi,
>
> I'll try to switch from Oracle to postgres for some small applications.
> Is it possible to build functions like Oracle's nvl or decode with pgplsql?
> How can I make a function like nvl that works for every datatype?
>
Write as many "nvl" functions as you have different types of params.
Overloading works just fine in postgres. (I do not know what function "nvl"
actually does, so maybe You can explain it.)
for example :
CREATE OR REPLACE FUNCTION nvl( INTEGER ) AS ...
CREATE OR REPLACE FUNCTION nvl( TEXT ) AS ...
Regards !