create table copy as select * from original
only produces the error "ORA-00997: illegal use of LONG datatype" - if
I create with "where 1=0" - I get the same - if I create a fresh and
empty table and "insert into copy select * from original" - I get just
the same again.
How am I using the LONG datatype illegally?
The version is Personal Oracle 8.0.4 - on Win98 - and the original
table looks like this:
SQL> desc cars
Name Null? Type
------------------------------- -------- ----
REGISTRATION NOT NULL CHAR(8)
MODEL NOT NULL CHAR(8)
CAR_GROUP NOT NULL CHAR(2)
DATE_BOUGHT DATE
COST NUMBER(6)
MAINT_INT NUMBER(5)
MILES_TO_DATE NUMBER(6)
PICTURE LONG RAW
All advice gratefully accepted....
JR
"hy" <huey...@singa.pore.net> wrote:
>here's something from the Oracle manual
>
>LONG columns cannot be used in the SELECT list of a subquery or queries
>combined by set operators (UNION, UNION ALL, INTERSECT, or MINUS).
>LONG columns cannot be referenced when creating a table with a query (CREATE
>TABLE . . . AS SELECT . . .) or when inserting into a table (or view) with a
>query (INSERT INTO . . . SELECT . . .).
>
>I think u may have to insert the row without the LONG value and then update
>the row.
>
>~hy
>
>Jeremy Russell wrote in message <3617b23f...@news.dircon.co.uk>...
>I have a table set up with a 'Long Raw' column, that contains picture
>information. The pictures display just fine in D/2000 - however, I
>would like to copy selected rows from the table. Using the SQL
>statement
>
>create table copy as select * from original
>
>only produces the error "ORA-00997: illegal use of LONG datatype" - if
>I create with "where 1=0" - I get the same - if I create a fresh and
>empty table and "insert into copy select * from original" - I get just
>the same again.
>
>How am I using the LONG datatype illegally?
Look at SQL*Plus's command COPPY. It anables you to copy data from one
table to another, including LONG columns. For the exact sysntax look
in SQL*Plus manual, for creating a COPY_TABLE and populating it with
the rows from CARS in the same schema with single command it will be
something like:
COPY TO my_username/my_pwd@my_db CREATE copy_table -
USING SELECT * FROM cars;
Don't forget to set LONG env variable in SQL*Plus to some large value
(large enough to save your largest LONG data) before using COPY
command. Namely, COPY truncates LONG data to the length set by
SQL*Plus's LONG setting.
HTH,
--
Jurij Modic <jmo...@src.si>
Certified Oracle7 DBA (OCP)
================================================
The above opinions are mine and do not represent
any official standpoints of my employer
LONG columns cannot be used in the SELECT list of a subquery or queries
combined by set operators (UNION, UNION ALL, INTERSECT, or MINUS).
LONG columns cannot be referenced when creating a table with a query (CREATE
TABLE . . . AS SELECT . . .) or when inserting into a table (or view) with a
query (INSERT INTO . . . SELECT . . .).
I think u may have to insert the row without the LONG value and then update
the row.
~hy
Jeremy Russell wrote in message <3617b23f...@news.dircon.co.uk>...