Withdata Software

Upsert data from CSV to Oracle table via command line on Windows

Want to upsert data from CSV file to existing Oracle table via command line on Windows?

Using ora-cmd, a Command-Line client for Oracle, you can upsert(merge) CSV/TSV/TXT data to Oracle table easily and fast.

Support Windows, Linux, and MacOS.

Download ora-cmd Windows version
ora-cmd.windows-386.zip
ora-cmd.windows-amd64.zip

No need to install Oracle client library.

Convenient to deploy to cloud. No need to run installation file, just uncompress and run, immediately.

Upsert/Merge CSV/TSV/TXT data into Oracle table via command line on Windows

1. In interactive mode:

ora-cmd> load loadtype=upsert
      > updatekey=id
      > table=media_messages 
      > datafile=f:\media_messages.csv 
      > delimiter=, 
      > quote=" 
      > header=y;

2. In batch mode:

ora-cmd dsn="pan:withdata@192.168.0.102/test" task=load loadtype=upsert updatekey=id table=media_messages datafile=f:\media_messages.csv delimiter=, quote=" header=y quit=y

“loadtype=upsert” will update row in table if “updatekey” id exists, or insert new row.

See parameters detail.


More about ora-cmd – Command-Line client for Oracle

Download ora-cmd Windows version
ora-cmd.windows-386.zip
ora-cmd.windows-amd64.zip

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.