Page 1 of 1

How to load data from flat file onto db2 table

PostPosted: Thu May 28, 2009 2:39 pm
by savitha_y
Hi,

I have a requirement where i need to load the data on db2 table from flat file using load utility.

the flat file contains 3 date fields which may contain null values

when i load the data from file it ended with an I/O error ...

Could any one please suggest, how to convert the flat file into table loadble format i.e. if date field have spaces it should load table field with null values else with the date value.

Thanks.

Re: How to load data from flat file onto db2 table

PostPosted: Fri May 29, 2009 1:39 am
by dick scherrer
Hello,

Keep in mind that there is no such thing as a "null value". NULL is a condition not a value. When working with NULLs, you need to allow for the "null-indicator".

If would be rather trivial to write a bit of code to to read the flat file, move the values to host variables and INSERT the rows once the "formatting" had been done (i.e. setting the null-indicator for those rows with spaces in the date field).

Re: How to load data from flat file onto db2 table

PostPosted: Tue Jun 02, 2009 11:09 pm
by arcvns
Were you able to load your table?