In Oracle 11gR2 i have this problem:
I have for example TABLE_A
with structure:
+--------+--------+--------+
| COL1 | COL2 | COL3 |
+--------+--------+--------+
and TABLE_B_
with structure:
+--------+--------+--------+
| COL2 | COL1 | COL3 |
+--------+--------+--------+
(so column definitions are the same but they are in different order)
Executing something like that:
INSERT INTO TABLE_A
SELECT * FROM TABLE_B;
Will work ok?
My problem is that making list of columns will exceed 32767 chars for EXECUTE IMMEDIATE
statement.
In newer Oracle release you can use CLOB in EXECUTE IMMEDIATE, but I don't know if the 32K limit applies also.
Anyway, you can use DBMS_SQL package to run statements bigger than 32k.