How to Use a LONG Column Datatype in 'LIKE' or 'ORDER BY' Clauses? (Doc ID 1390501.1)

Last updated on DECEMBER 15, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.3 and later
Information in this document applies to any platform.
***Checked for relevance on 15-Dec-2016***

Goal

How to use a long column in 'like' or 'order by' clause?
For example:

SQL> select * from all_triggers
where trigger_body like '%THEN%'; 2
where trigger_body like '%THEN%'
*
ERROR at line 2:
ORA-00932: inconsistent datatypes: expected NUMBER got LONG

SQL> desc all_triggers
Name       Null?   Type
-------- -------- ----------
TRIGGER_BODY      LONG



Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms