csvcommit
A simple program to import csv files into an existing Oracle table.
The input database table is compared to the input csv. If there are fields names in the csv that match field names in the database table, those fields are imported.
Much easier than SQL*Loader 😄
Be aware that this truncates the original database table
Usage
The csv needs to have a field list as the first row.
You need to set the flags in the below example. The autoincrementfield
flag is optional.
csvcommit \
-csv "./import_table.csv" \
-conn "user/password@host/service" \
-schema "my_schema" \
-table "my_table" \
-autoincrementfield "ID"
Installation
Install go and make sure you add $GOPATH/bin
to your PATH
.
Then build and install
go get github.com/andygarfield/csvcommit/...
Limitations
This is currently only working with VARCHAR
, NVARCHAR2
and NUMBER
types. Hoping to add more in the future.