Move data across DBes.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 05 Apr 2018 19:22:33 +0300
changeset 2243 eccc5846e1dd
parent 2242 1921c2a985c9
child 2244 7d8a914e06ee
Move data across DBes.
oracle.rst
--- a/oracle.rst	Wed Mar 14 17:31:26 2018 +0200
+++ b/oracle.rst	Thu Apr 05 19:22:33 2018 +0300
@@ -505,3 +505,25 @@
 Find time at timezone::
 
   select SYSTIMESTAMP at time zone 'GMT' from dual;
+
+Move data across DBes
+=====================
+
+Format ``select`` data as ``insert`` statements with ``/*insert*/`` hind (use ``F5`` key in Oracle
+developer)::
+
+  select /*insert*/ * from tbl;
+
+Another useful hint::
+
+  select /*csv*/ * from tbl;
+
+Alternatively enable output as ``insert`` statments (use ``F5`` key in Oracle developer)::
+
+  set sqlformat insert;
+  select * from tbl;
+
+  spool /home/user/insert.sql;
+  select * from tbl where ...;
+  spool off;
+