Search notes:

Oracle: SQL Loader Example: load dates - and use sysdate for empty dates

An example that loads dates. When these dates are empty, it inserts sysdate instead.
create table tq84_sql_loader_09 (
  txt              varchar2(10)   not null,
  dt               date           not null,
  num              number         not null
);
Github repository Oracle-Patterns, path: /SQLLoader/ex_09/create_table.sql
load data
infile 'load_09.dat' "str '\r\n'"
insert
into table tq84_sql_loader_09
(
  txt          position( 1:10),
  dt           position(11:20)  "nvl(to_date(trim(:dt), 'dd.mm.yyyy'), sysdate)",
  num          position(21:24) 
)
Github repository Oracle-Patterns, path: /SQLLoader/ex_09/load_09.ctl
abcdefghij18.07.2015  42
!!!!!!!!!!          9876
Github repository Oracle-Patterns, path: /SQLLoader/ex_09/load_09.dat
start create_table

host  sqlldr control=load_09.ctl userid=rene/rene

select * from tq84_sql_loader_09;

drop table tq84_sql_loader_09 purge;
Github repository Oracle-Patterns, path: /SQLLoader/ex_09/all.sql

See also

Other SQL Loader examples
http://stackoverflow.com/questions/27830824/sqlloader-using-sysdate-if-incoming-value-is-blank.
SQL*Loader

Index