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
Enteros in Healthcare: Database Performance, Cloud FinOps, and AIOps for Scalable Operations
- 24 February 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…
Enhancing Database Security in the Technology Sector with Enteros: A Proactive Approach to Performance and Protection
In the fast-evolving world of finance, where banking and insurance sectors rely on massive data streams for real-time decisions, efficient anomaly man…
Enteros and Generative AI in the Insurance Sector: Performance Monitoring and Enterprise Efficiency
- 21 February 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…
Enhancing Real Estate IT Efficiency with Enteros: Leveraging Observability, Cloud FinOps, and Database Performance Optimization
In the fast-evolving world of finance, where banking and insurance sectors rely on massive data streams for real-time decisions, efficient anomaly man…