This content has been marked as final. Show 6 replies
assuming you want to convert data always from source_table to target_table knowing the column names, let's say:
You can just copy the data using SQL:
SQL> CREATE TABLE source_table(col1 VARCHAR2(10), col2 LONG); Table created. SQL> CREATE TABLE target_table(col1 VARCHAR2(10), col2 CLOB); Table created.
Or, as a procedure:
INSERT INTO target_table SELECT col1, TO_LOB(col2) FROM source_table;
Hope it helps.
CREATE OR REPLACE PROCEDURE migrate_to_clob IS BEGIN EXECUTE IMMEDIATE 'INSERT INTO target_table SELECT col1, TO_LOB(col2) FROM source_table'; END;
I've noticed you keep posting the same question in new threads.
Like over here: procedure to parser long datatypes
Now, I thought I helped you out, but it doesn't seem to be the case?
You now know about TO_LOB etc., you can do it relatively easy in SQL and you could put that in a PL/SQL procedure (using dynamic SQL), so:
Please explain in detail what's (still) giving you trouble.
And, just like your other question:
provide us some sample data, preferrably using CREATE TABLE and INSERT statements.