Search notes:

ORA-00997: illegal use of LONG datatype

ORDER BY

A long data type cannot be used in an order by clause.
select *
from
   user_views
order by
   text;

CREATE TABLE … AS …

The first of the following statements causes an ORA-00997: illegal use of LONG datatype error because the column data_default of user_tab_cols is a long. This problem can somewhat be mitigated by using to_lob which creates a clob from the long.
However, if to_lob() is used in a case when clause, we get the error ORA-00932: inconsistent datatypes: expected - got LONG.
create table tq84_a as select                                  data_default       as data_default      from user_tab_cols;
create table tq84_b as select                           to_lob(data_default)      as data_default_clob from user_tab_cols;
create table tq84_c as select        case when 1=1 then to_lob(data_default) end  as data_default_clob from user_tab_cols;
create table tq84_d as select to_lob(case when 1=1 then        data_default  end) as data_default_clob from user_tab_cols;
If the table is is accessed via a database link, the error is also thrown:
create table tq84_e as select                           to_lob(data_default)      as data_default_clob from user_tab_cols @ dblink;

See also

Other Oracle error messages such as ORA-00932: inconsistent datatypes: expected … got …

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758199565, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/errors/ORA-00997_illegal-use-of-LONG-datatype(62): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78