Import data from CSV to Oracle via command line on Windows

Want to import data from CSV file to Oracle via Command Line Interface (CLI) on Windows?

Using ora-cmd, a Command Line Interface (CLI) client for Oracle, you can import data from CSV file to Oracle easily and fast. Direct Interaction or Scripting and Automation.

  • No need to install Oracle client library.
  • Convenient to deploy to cloud. No need to run installation file, just uncompress and run, immediately.
  • Commands are entered into a terminal or command prompt, accessed from local or remote (like SSH).
  • Support Windows, Linux, and MacOS.

Download ora-cmd Windows version Download ora-cmd

Import data from CSV file to Oracle via command line on Windows

1. In interactive mode:

ora-cmd> load loadtype=replace
      > table=media_messages 
      > datafile=/data/media_messages.csv 
      > delimiter=, 
      > quote=" 
      > header=y;

2. In batch mode:

ora-cmd dsn="pan:withdata@192.168.0.102/test" task=load loadtype=replace table=media_messages datafile=/data/media_messages.csv delimiter=, quote=" header=y quit=y

“loadtype=replace” will delete all data in table before inserting.

See parameters detail.


More about ora-cmd – Command Line Interface (CLI) tool for Oracle

Download ora-cmd Windows versionDownload ora-cmd

CSV → Oracle reference

Type mapping

Value kindin CSVin Oracle
Int1234NUMBER(10)
Bigint9007199254740993NUMBER(19)
Decimal1234.56NUMBER(p,s)
Float1.234e+10BINARY_DOUBLE
Textquoted only when it contains a comma or a quoteVARCHAR2(n)
Long textmust be quoted; line breaks inside force multi-line recordsCLOB
Date2026-09-18DATE
Datetime2026-09-18 14:30:00TIMESTAMP
Binarynot representable - base64 or hex stringBLOB
BooleanTRUE / FALSE, or 1 / 0 depending on the writerNUMBER(1)
JSONthe whole JSON value quoted, with internal quotes doubledCLOB

Dialect differences

CSV is a file format and Oracle is a database server, so the target has to be told the types the file never carried – the rows below are where the two sides diverge.

Propertyin CSVin Oracle
port—1521
identifiersDouble quotes; a literal quote is doubled ("" )"double quotes"
row limit—FETCH FIRST n ROWS ONLY
datesConventional text: 2026-09-18 or 2026-09-18 14:30:00DATE, TIMESTAMP
long text—CLOB, NCLOB
binaryNot supportedBLOB, BFILE
separatorComma ","—
encodingNo declaration - UTF-8 works only with a BOM—
typingNone - every field is text—
shapeFlat table, optional header rowTables of rows and columns
ceilingNo formal limit; row count bounded by memory—

Command line

SideCommand
Oracleexp / expdp
Oracle (load)sqlldr (SQL*Loader)

Convert your data online, free

Free in-browser converters for CSV, Excel, JSON, XML and SQL: Withdata Online Data Conversion. Large files, batch conversion or scheduling? See the offline desktop apps, or browse all data conversion tools.


Posted

in

by