Skip to main content

How to Import CSV to Database in SQL Developer

Load CSV files, Excel spreadsheets, and text files directly into your database tables. Works with Oracle, MySQL, PostgreSQL, and SQL Server.

Import CSV data to database

Supported File Formats

Import data from these formats

📄

CSV (Comma Separated Values)

Most common format. Works with any delimiter (comma, tab, semicolon).

📊

Excel (.xlsx, .xls)

Import directly from Excel spreadsheets. Select specific sheets.

📝

Text Files (.txt)

Fixed-width or delimited text files. Custom delimiter support.

Import CSV Step by Step

Import data into an existing table

1

Find Your Table

In the Connections panel, expand your database connection → Tables. Find the table you want to import data into.

2

Open Import Wizard

Right-click on the table and select Import Data. The Data Import Wizard will open.

3

Select Your File

Click Browse and select your CSV file. SQL Developer will show a preview of the first few rows.

4

Configure Options

Header: Check if first row contains column names
Delimiter: Usually comma, but select tab or semicolon if needed
Encoding: UTF-8 for most files

5

Map Columns

Match each CSV column to a table column. SQL Developer auto-matches by name, but you can adjust manually.

6

Finish Import

Click Finish to start the import. Watch the progress bar and check the log for any errors.

Import to a New Table

Create table from CSV automatically

Don't have a table yet? SQL Developer can create one from your CSV:

  1. Right-click on Tables (not a specific table)
  2. Select Import Data
  3. Choose your CSV file
  4. SQL Developer will suggest column names and data types based on your data
  5. Adjust the table name and column definitions as needed
  6. Click Finish - the table is created and data is imported

Tips for Large Imports

Importing thousands or millions of rows?

!

Disable Indexes First

For very large imports, disable indexes before importing and rebuild them after. This can make imports 10x faster.

!

Use Batch Commits

In the import wizard, set commit frequency to every 1000-5000 rows. This prevents running out of undo space.

!

Check Date Formats

Date parsing errors are common. Make sure your CSV date format matches what SQL Developer expects (or configure the format in the wizard).

Common Import Errors

Solutions to typical problems

"Value too large for column"

Your data has values longer than the column allows. Either truncate the data in your CSV, or ALTER TABLE to increase the column size.

"Invalid number" or "Not a valid date"

Data type mismatch. A text value is being inserted into a number column, or the date format doesn't match. Check the column mapping and format settings.

"Unique constraint violated"

Your CSV contains duplicate values in a unique or primary key column. Remove duplicates from the CSV or change the import to update existing rows.

Need to Export Instead?

Export your query results to CSV, Excel, JSON, or SQL INSERT statements.