Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating sql insert into for Oracle

Tags:

sql

oracle

The only thing I don't have an automated tool for when working with Oracle is a program that can create INSERT INTO scripts.

I don't desperately need it so I'm not going to spend money on it. I'm just wondering if there is anything out there that can be used to generate INSERT INTO scripts given an existing database without spending lots of money.

I've searched through Oracle with no luck in finding such a feature.

It exists in PL/SQL Developer, but errors for BLOB fields.

like image 330
Alhambra Eidos Avatar asked Oct 30 '09 11:10

Alhambra Eidos


People also ask

How do I insert into Oracle?

To insert data into Oracle tables using SQL-Plus, you must be logged on to the server. Data can be added to tables via the INSERT statement. Remember that this inserts data one row at a time. You can create your INSERT statements in notepad or other similar editor, and copy them into the SQL-Plus editor.

How can I insert values from one table to another in Oracle?

The simplest way to create an Oracle INSERT query to list the values using the VALUES keyword. For example: INSERT INTO suppliers (supplier_id, supplier_name) VALUES (5000, 'Apple'); This Oracle INSERT statement would result in one record being inserted into the suppliers table.

Can we use insert in Oracle function?

Data InsertionThe INSERT command can also take the values directly from another table using 'SELECT' statement rather than giving the values for each column. Through 'SELECT' statement, we can insert as many rows as the base table contains. Syntax: BEGIN INSERT INTO <table_name>(<column1 >,<column2>,...


2 Answers

You can do that in PL/SQL Developer v10.
1. Click on Table that you want to generate script for.
2. Click Export data.
3. Check if table is selected that you want to export data for.
4. Click on SQL inserts tab.
5. Add where clause if you don't need the whole table.
6. Select file where you will find your SQL script.
7. Click export.
enter image description here

like image 31
Matas Vaitkevicius Avatar answered Oct 02 '22 01:10

Matas Vaitkevicius


Oracle's free SQL Developer will do this:

http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html

You just find your table, right-click on it and choose Export Data->Insert

This will give you a file with your insert statements. You can also export the data in SQL Loader format as well.

like image 82
Doug Porter Avatar answered Oct 02 '22 00:10

Doug Porter