Is there an Oracle SQL tool that creates insert statements from a result set?

Is there an Oracle SQL tool that creates insert statements from a result set? We are currently allowed to use a tool called SQL Station. I would like to offer either a tool like Rapid SQL or CrazySQuirrell, or create my own reusable sql fragment.

+3
source share
9 answers

I found this solution that I am using now. Thanks for the help. Turns out we can also use SQL +. For some reason, I cannot run it in SQL Station.

COPY FROM userid/password @from_DB TO userid/password > @to_DB INSERT toDB_tablename SELECT * FROM fromDB_tablename ....;

;

+1

? , SELECT, , SQL:

INSERT INTO table2 (columnA, columnB)
  SELECT columnA, columnB
    FROM table1;
+4

PL/SQL Developer . PL/SQL Developer, Oracle SQL Developer, , , PL/SQL Developer . SQL Developer, PL/SQL Dev. CSV, XML HTML.

WINE, Linux.

+3

, cx_OracleTools .

http://cx-oracletools.sourceforge.net/

  • CompileSource - ,
  • CopyData -
  • DbDebugger - PL/SQL
  • DescribeObject - SQL
  • DescribeSchema - SQL
  • DumpCSV - select ,
  • DumpData - select
  • ExportColumn -
  • ExportData -
  • ExportObjects - SQL
  • ExportXML - XML
  • GeneratePatch - SQL script,
  • GenerateView -
  • ImportColumn -
  • ImportData - , ExportData​​li >
  • ImportXML - XML (, ExportXML)
  • RebuildTable - SQL script,
  • RecompileSource -
+3

, Oracle sql developer.Its otn.oracle.com

+1

, :

Select
    'Insert Into MyOtherTableTable Values(''' || MyMainTableColumn1 || ''' and ''' || MyMainTableColumn2 || ''')'
From MyMainTable
0

, . . , . .

0

, , -. , "" . - " ", . .

0

Oracle SQL-Developer script (F5):

select /*insert*/ 
  * from dual;

:

 Insert into "dual" (DUMMY) values ('X');

/* csv */"/* html */

source: http://www.thatjeffsmith.com/archive/2012/05/formatting-query-results-to-csv-in-oracle-sql-developer/

SELECT /*csv*/ * FROM scott.emp;
SELECT /*xml*/ * FROM scott.emp;
SELECT /*html*/ * FROM scott.emp;
SELECT /*delimited*/ * FROM scott.emp;
SELECT /*insert*/ * FROM scott.emp;
SELECT /*loader*/ * FROM scott.emp;
SELECT /*fixed*/ * FROM scott.emp;
SELECT /*text*/ * FROM scott.emp;
0
source

Source: https://habr.com/ru/post/1706191/


All Articles