Preamble
Oracle/PLSQL NULLIF function compares expr1 and expr2. If expr1 and expr2 are equal, the function NULLIF returns NULL. Otherwise, it returns expr1.
Oracle/PLSQL syntax of the function NULLIF
NULLIF( expr1_id, expr2_id )
Parameters or arguments
- expr1_id and expr2_id must either have numerical values or values that have the same data type.
Note:
- The function NULLIF returns NULL if expr1_id and expr2_id are equal.
- The function NULLIF returns expr1 if expr1_id and expr2_id are not equal.
- expr1 can be an expression which is evaluated as NULL but cannot be literal NULL.
The function NULLIF can be used in the following versions of Oracle/PLSQL
|
Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i
|
Let’s consider some examples of Oracle NULLIF function and learn how to use NULLIF function in Oracle PLSQL.
SELECT NULLIF(12, 12) AS RESULT FROM DUAL;
-result: NULL
SELECT NULLIF(12, 13) AS RESULT FROM DUAL;
-result: 12
SELECT NULLIF('apples', 'apples') AS RESULT FROM DUAL;
-RESULT: NULL
SELECT NULLIF('apples', 'oranges') AS RESULT FROM DUAL;
-RESULT: apples
SELECT NULLIF(NULL, 12) AS RESULT FROM DUAL;
SELECT NULLIF(NULL, 12) AS RESULT FROM DUAL
ORA-00932: inconsistent datatypes: expected - got CHAR
-- ORA-00932 error because expr1 can't be literal NULL
NULLIF FUNCTION IN ORACLE SQL WITH EXAMPLE
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 Predictive SQL Performance Analytics Accelerates Application Modernization
- 18 June 2026
- Database Performance Management
Application modernization has become a strategic priority for enterprises seeking greater agility, scalability, and competitive advantage. Organizations are increasingly transforming legacy systems into cloud-ready, data-driven, and highly scalable architectures to meet growing digital demands. Whether migrating monolithic applications to microservices, adopting cloud-native platforms, or modernizing data infrastructure, enterprises face a common challenge: maintaining database performance … Continue reading “How Predictive SQL Performance Analytics Accelerates Application Modernization”
How to Modernize BFSI Cost Management with Enteros Database Software and Cost Attribution Analytics
Introduction The Banking, Financial Services, and Insurance (BFSI) industry is undergoing rapid transformation driven by digital banking, fintech innovation, regulatory requirements, customer expectations, and growing data volumes. As organizations continue investing in cloud platforms, digital services, AI-powered applications, and advanced analytics, technology spending has become one of the largest operational expenses across the financial sector. … Continue reading “How to Modernize BFSI Cost Management with Enteros Database Software and Cost Attribution Analytics”
The Business Value of AI-Powered Database Performance Analytics for Digital Enterprises
In today’s digital economy, enterprise success increasingly depends on application performance, operational agility, and the ability to deliver seamless user experiences at scale. From e-commerce platforms and financial services to SaaS applications and digital healthcare systems, businesses rely heavily on data-driven applications to serve customers, process transactions, and generate insights in real time. At the … Continue reading “The Business Value of AI-Powered Database Performance Analytics for Digital Enterprises”
How to Transform Financial Operations with Enteros Database Software and Growth Intelligence
- 17 June 2026
- Database Performance Management
Introduction Financial institutions operate in one of the most data-intensive and highly regulated environments in the world. Banks, insurance companies, investment firms, fintech organizations, and financial service providers rely heavily on digital platforms to process transactions, manage risk, deliver customer experiences, and drive business growth. Today’s financial ecosystems support: Digital banking platforms Payment processing systems … Continue reading “How to Transform Financial Operations with Enteros Database Software and Growth Intelligence”