I am using TTU (fastload) to load data into DB table. Following is the fastld script for data load:
LOGON 127.0.0.1/test,*****;
DATABASE MyDb;
BEGIN LOADING "MyTable"
ERRORFILES error_table_1_607712459, error_table_2_1744826307
CHECKPOINT 0;
SET RECORD VARTEXT DELIMITER ',' QUOTE YES '"' ;
DEFINE in_field_0 (VARCHAR(1000)),in_field_1 (VARCHAR(1000)),
FILE = /tmp/fastload_data_file390318d5-b42d-47d6-8c0f-6822a0bbb6ef.dat;
INSERT INTO "MyTable" ("data","num" ) VALUES (:in_field_0,:in_field_1);
END LOADING;
LOGOFF;
Data file: fastload_data_file390318d5-b42d-47d6-8c0f-6822a0bbb6ef.dat
"Hello World", "1"
"","2"
" ", "3"
null, "4"
After load: MyTable
msg num
Hello World 1
null 2
3
null 4
When the data file has empty string (""), fastload inserting null into the DB. I have tried using TTU 16.20 and 17.00 on Ubuntu OS, behaviour is same across the versions. I am wondering, how to avoid inserting Null into the table. Any suggestions?