Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why NVL is not returning not null value

Rajneesh S-OracleFeb 19 2020 — edited Feb 19 2020

Hello All,

I have executed below 2 SQLs:

SELECT

NVL(COLUMN_NAME,'INVALID_COLUMN') AS FIELD_NAME

FROM ALL_TAB_COLUMNS WHERE TABLE_NAME ='REL_RELATIONS' AND COLUMN_NAME ='FIRST_NAME'

Output:

pastedImage_0.png

SELECT

NVL(COLUMN_NAME,'INVALID_COLUMN') AS FIELD_NAME

FROM ALL_TAB_COLUMNS WHERE TABLE_NAME ='REL_RELATIONS' AND COLUMN_NAME ='FIRST_NAME_XYZ'

Output:

pastedImage_1.png

I was expecting INVALID_COLUMN as output than NULL here.

Am I missing some thing?

Thanks,

Rajneesh

This post has been answered by Cookiemonster76 on Feb 19 2020
Jump to Answer
Comments
Post Details
Added on Feb 19 2020
4 comments
8,910 views