Within a single SQL statement, all LONG columns, updated tables, and locked tables must be located on the same database.
这是官方文档找到的,连oracle都希望你放弃long,转成lob
全文如下:
LONG Datatype
LONG columns store variable-length character strings containing up to 2 gigabytes, or 231-1 bytes. LONG columns have many of the characteristics of VARCHAR2 columns. You can use LONG columns to store long text strings. The length of LONG values may be limited by the memory available on your computer.
--------------------------------------------------------------------------------
Note:
Oracle Corporation strongly recommends that you convert LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. For more information, see "TO_LOB".
You can reference LONG columns in SQL statements in these places:
SELECT lists
SET clauses of UPDATE statements
VALUES clauses of INSERT statements
The use of LONG values is subject to some restrictions:
A table cannot contain more than one LONG column.
You cannot create an object type with a LONG attribute.
LONG columns cannot appear in integrity constraints (except for NULL and NOT NULL constraints).
LONG columns cannot be indexed.
A stored function cannot return a LONG value.
Within a single SQL statement, all LONG columns, updated tables, and locked tables must be located on the same database.
LONG columns cannot appear in certain parts of SQL statements:
WHERE clauses, GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses or with the DISTINCT operator in SELECT statements
The UNIQUE operator of a SELECT statement
The column list of a CREATE CLUSTER statement
The CLUSTER clause of a CREATE MATERIALIZED VIEW statement
SQL functions (such as SUBSTR or INSTR)
Expressions or conditions
SELECT lists of queries containing GROUP BY clauses
SELECT lists of subqueries or queries combined by set operators
SELECT lists of CREATE TABLE ... AS SELECT statements
SELECT lists in subqueries in INSERT statements
Triggers can use the LONG datatype in the following manner:
A SQL statement within a trigger can insert data into a LONG column.
If data from a LONG column can be converted to a constrained datatype (such as CHAR and VARCHAR2), a LONG column can be referenced in a SQL statement within a trigger.
Variables in triggers cannot be declared using the LONG datatype.
:NEW and :OLD cannot be used with LONG columns.
You can use the Oracle Call Interface functions to retrieve a portion of a LONG value from the database. See Oracle Call Interface Programmer's Guide.