How to overcome a few restrictions of LONG data type
Last updated on DECEMBER 27, 2017
Applies to:Oracle Database - Personal Edition - Version 220.127.116.11 and later
PL/SQL - Version 18.104.22.168 and later
Oracle Database - Enterprise Edition - Version 22.214.171.124 and later
Information in this document applies to any platform.
***Checked for relevance on 17-Jul-2016***
You try to select distinct values from a long column, create a table using as select with a long column, insert into a table by selecting the long column from another table and an ORA-00997: illegal use of LONG datatype ... occurs
It is a restriction of the long columns that they cannot be used with a DISTINCT operator and cannot be referenced when creating a table with query
(CREATE TABLE...AS SELECT...) or when inserting into a table(or view) with a query (INSERT INTO ... SELECT...).
This article gives a workaround to these restrictions using a table function in 8i and above.
This workaround is applicable if and only if your data in the long column is less than 4K.
No relevant change to the database has been done.
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