Re: Example of a SQL function that returns a non-NULL value even if one of its parameters is NULL

From: Jonathan Lewis <jlewisoracle_at_gmail.com>
Date: Thu, 12 Jan 2023 11:53:29 +0000
Message-ID: <CAGtsp8mw3jt8f_MNHAPo5A-hYoWTPaBwqx6rqgECvh8JQ6PjoQ_at_mail.gmail.com>



concat()

SQL> select concat('a',null) from dual;

C
-
a

1 row selected.

SQL> select concat(null,'a') from dual;

C
-
a

1 row selected.

Regards
Jonathan Lewis

On Thu, 12 Jan 2023 at 06:21, Iggy Fernandez <iggy_fernandez_at_hotmail.com> wrote:

> Inbuilt SQL functions seem to return NULL if one of their parameters is
> NULL. Here are a couple of examples.
>
> INSTR(NULL, 'Hello, World!')
> INSTR('Hello, World!', NULL)
>
> Can anyone think of an inbuilt SQL function that returns a non-NULL value
> even if one of its parameters is NULL?
>
> Best,
> Iggy
>
>
>
>
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jan 12 2023 - 12:53:29 CET

Original text of this message