Preamble
Oracle/PLSQL NVL function allows you to replace the value when there is a Null value.
Oracle/PLSQL syntax of NVL functions
NVL( string1_id, replace_with_id )
Parameters or arguments
- string1_id – string which is checked for a Null value.
- replace_with_id – the return value if string1 is Null.
NVL function in the following versions of Oracle/PLSQL
Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
|
Let’s look at some examples of the Oracle NVL function and learn how to use the NVL function in Oracle PLSQL.
SELECT NVL(suppl_city, 'n/a')
FROM suppls;
The SQL query above will return ‘n/a’ if the suppl_city field contains a Null value. Otherwise, it will return the suppl_city value.
Another example of using NVL function in Oracle/PLSQL:
SELECT suppl_id,
NVL(suppl_desc, suppl_name)
FROM suppls;
SQL query will return suppl_name field if suppl_desc contains Null. Otherwise, it will return suppl_desc.
Last example of using NVL function in Oracle/PLSQL:
SELECT NVL(commission, 0)
FROM sales;
SQL query will return 0 if the commission field contains Null value. Otherwise, it will return the commission field value.
About Enteros
Enteros offers a patented database performance management SaaS platform. It proactively identifies root causes of complex business-impacting database scalability and performance issues across a growing number of clouds, RDBMS, NoSQL, and machine learning database platforms.
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
How Enteros Uses AI-Powered Cost Estimation and Cloud FinOps to Optimize Database Performance in the Technology Sector
- 26 August 2025
- Database Performance Management
In the fast-evolving world of finance, where banking and insurance sectors rely on massive data streams for real-time decisions, efficient anomaly man…
How Enteros Leverages AI SQL, AIOps, and Cloud FinOps for Smarter Cost Attribution and Database Performance in the Financial Sector
In the fast-evolving world of finance, where banking and insurance sectors rely on massive data streams for real-time decisions, efficient anomaly man…
How Enteros Uses AI-Powered Database Performance Management to Drive RevOps Efficiency in the Real Estate Sector
- 25 August 2025
- Database Performance Management
In the fast-evolving world of finance, where banking and insurance sectors rely on massive data streams for real-time decisions, efficient anomaly man…
How Enteros Leverages Performance-Driven AI and an Advanced AI Tech Stack to Transform Database Efficiency in the Banking Sector with AIOps and Cloud FinOps
In the fast-evolving world of finance, where banking and insurance sectors rely on massive data streams for real-time decisions, efficient anomaly man…