We need to copy records between two Oracle database schemas.
Manually, we can do this using the SQL*PLUS COPY command:
http://www.oracleutilities.com/SQLPLus/copy.html
However, we'd like to automate this using cx_Oracle if possible (we also need to do some other things - e.g. SSH interactions, hence the use of Python and cx_Oracle).
However, if I try to execute COPY inside cx_Oracle, it doesn't seem to like the command:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cx_Oracle.DatabaseError: ORA-00900: invalid SQL statement
I'm guessing this is because COPY is a SQL*PLUS specific command, as opposed to part of the standard SQL spec?
Anyhow, is there any way of getting the COPY command (or any other SQL*PLUS specific extensions) to work under cx_Oracle?
I believe it's possible to use INSERT INTO...SELECT to achieve something similar, however that requires a database link if the two databases in question are on separate Oracle instances or hosts, and we don't always have permission to create those links.
Cheers, Victor