Question

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

Was it helpful?

Solution 2

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

OTHER TIPS

Perhaps this discussion would help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top