The situation is : I want to export table to XML file locally on DB1, and then import this xml on remote database DB2. I already have the procedure to do export and import, but how to send the data to the remote server?
I want to write a batch file to do export locally first , it can generate an xml file or return a clob string. then import the data into remote database server.
How could I do that ?
Based on this discussion on AskTom, it seems you can’t fetch a CLOB over a Database Link.
However, there are many LOB operations that work over a DBLink. You can SELECT a LOB over a database link for instance.
In your case, you could create a Global Temporary Table in DB1 that would contain your CLOB and import this clob directly in DB2.
In DB1 you would have:
GTT (temp_data XMLFile) -- or CLOBprocextracts/filters your XMLFile and inserts into the temporary tableGTTIn DB2:
DBL1to DB1proc@DBL1,INSERT INTO dest_table (dest_col) (SELECT temp_data FROM gtt@DBL1)