Q
Problem solve Get help with specific problems with your technologies, process and projects.

Use of decimal in NVL function

I would like to ask about the NVL function. Is there any difference between these?

I would like to ask about the NVL function.

Which is better:

    select nvl(col1,0)
    from ...;

or

    select nvl(col1,0.0)
    from ...;

if col1's type is number.

I would like to know if there is any difference between them.

The only difference is in the format of the literal--if you want a decimal point in your result, then use the second form. The values are the same and there should be no difference in performance, since in the case of a null value Oracle just returns the literal that you've specified.

Dig Deeper on Oracle database performance problems and tuning

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close