LONG is an Oracle-specific legacy data type used to hold very large character strings (up to 2,147,483,647 bytes). It predates the ANSI SQL LOB types and Oracle’s own CLOB/BLOB family. Because LONG was introduced when hardware and SQL capabilities were limited, it comes with severe restrictions: only one LONG column is allowed per table, the column cannot be indexed, and it cannot appear in WHERE, ORDER BY, GROUP BY, JOIN, or subquery predicates. LONG values can be selected and inserted, but functions (e.g., SUBSTR) and operators generally do not work. Oracle added CLOB and NCLOB in later versions to overcome these limitations, and Oracle recommends migrating any remaining LONG columns to CLOB. Despite its age, LONG still exists for backward compatibility, so engineers maintaining legacy schemas must understand its behavior and pitfalls.
CLOB, LONG RAW, BLOB, NCLOB, VARCHAR2, LOB data types, TO_CLOB, TO_LOB
Oracle Database 7
A single LONG column can hold up to 2,147,483,647 bytes (about 2 GB) of character data.
Yes. Use ALTER TABLE to add a CLOB column, copy the data with TO_CLOB, then drop the LONG column.
Internally, LONG was implemented as an unstructured large object with stream semantics, making predicate evaluation impractical. Modern LOBs fix this.
No. LONG stores character data, while LONG RAW stores binary data. Both share the same restrictions.