views:

94

answers:

2

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

A: 

Perhaps this discussion would help.

DCookie
A: 

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

Virat Kadaru