0
votes

I am writing a program in java where I need to create a copy of a table (without data). for that I am using the following query

CREATE TABLE NEW_TABLE AS
SELECT * FROM OLD_TABLE

I have come across a table where one of the columns has the data type LONG RAW which is depricated.

I tried using the query below but it did not work. (ORA-01003: no statement parsed )

CREATE TABLE NEW_TABLE AS
SELECT ID, COL1, COL2, TO_LOB(COL3) FROM OLD_TABLE

Can someone tell me a simple query for this. It should be able to store the values from the previous table. I am using oracle 10g

Thanks in advance.

EDIT:

Sorry it was my mistake, the above query worked fine but I was calling executeQuery instead of executeUpdate

2
when you say "I tried using the query below but it did not work." in what way did it not work? Please describe the behaviour, including error message (if any). Also, what version of Oracle are you using? - APC
I have added the error and version. - Virat Kadaru

2 Answers

0
votes
0
votes

Sorry it was my mistake, the above query worked fine but I was calling executeQuery instead of executeUpdate which was throwing an SQLException