How to Fix ORA-00932: Inconsistent Datatypes in Oracle

Make data types agree in comparisons, CASE branches, and NVL calls, and fix ORA-00932 with explicit conversions.

ORA-00932 means an expression combines values of data types that cannot be used together there and that Oracle will not convert implicitly: a date compared with a number, a CASE whose branches return a number and a string, or NVL with a fallback of the wrong type. In Oracle AI Database 26ai the message shows the offending expression and both data types.

Reproduce the Error

Example:

create table demo_docs (doc_id number, title varchar2(40), created date);
insert into demo_docs values (1, 'Plan', date '2026-03-15');
commit;
select doc_id from demo_docs where created = 100;
select case when doc_id = 1 then doc_id else 'none' end from demo_docs;
select nvl(created, 0) from demo_docs;

Output:

Table DEMO_DOCS created.

1 row inserted.

Commit complete.

Error starting at line : 4
In command -
select doc_id from demo_docs where created = 100
Error at Command Line : 4 Column : 46
Error report -
SQL Error: ORA-00932: expression (100) is of data type NUMBER, which is incompatible with
expected data type DATE

Error starting at line : 5
In command -
select case when doc_id = 1 then doc_id else 'none' end from demo_docs
Error at Command Line : 5 Column : 46
Error report -
SQL Error: ORA-00932: expression ('none') is of data type CHAR, which is incompatible with
expected data type NUMBER

Error starting at line : 6
In command -
select nvl(created, 0) from demo_docs
Error at Command Line : 6 Column : 21
Error report -
SQL Error: ORA-00932: expression is of data type NUMBER, which is incompatible with
expected data type DATE
  • A DATE column cannot be compared with the number 100.
  • CASE takes its type from the first branch, a number, so the string 'none' does not fit.
  • NVL takes the type of its first argument, a date, so 0 does not fit.

Fix: Make the Types Agree

Example:

select doc_id from demo_docs where created = date '2026-03-15';
select case when doc_id = 1 then to_char(doc_id) else 'none' end as label from demo_docs;
select nvl(to_char(created, 'YYYY-MM-DD'), 'none') as created from demo_docs;

Output:

   DOC_ID
_________
        1

LABEL
________
1

CREATED
_____________
2026-03-15

Compare dates with date literals, and convert explicitly with TO_CHAR, TO_NUMBER, or TO_DATE so every branch and argument has the same type.

Things to Know

  • CLOB columns cannot be compared with = or used in DISTINCT; in Oracle AI Database 26ai that raises ORA-22848. Compare with DBMS_LOB.COMPARE or convert a part with TO_CHAR.
  • Implicit conversion between strings and numbers or dates does happen in many places, but between dates and numbers it does not.
  • In set operators, columns of different type groups raise ORA-01790 instead.

Related Guides

Conclusion

ORA-00932 means values of incompatible data types meet in one expression. Read the expression and types from the message, and convert explicitly so comparisons, CASE branches, and NVL arguments all share one type.

Vinish Kapoor
Vinish Kapoor

An Oracle ACE, author of four books on Oracle APEX, SQL and PL/SQL, and Oracle Forms, and a software developer building Oracle database applications since 2001.

guest

0 Comments
Oldest
Newest Most Voted