Trying to use loadData to load a simple CSV file into a table. Im sure got tablename spec’d correct and ant -debug shows the file is read. Build completes successful, entries are inserted into the DATABASECHANGELOG table, but no data gets loaded.
The CSV data contains only numeric/string datatype.
Are there some common steps to diagnose problems with this? Is there anyway to get more debug info?
-David
Debugging… first problem is that I did not keep my header columns in the csv file itself. The LoadDataChange.java:94/101 skips the header line assuming it is there and continues on to parse records. Which since I only had one record, it skips the rest of the file.
Solved!
Glad you found it. We do assume a header line, although it would be worth adding support to assume there is not one.
Thanks for the update, and let us know if you run into any other troubles.
Nathan
Next issue, trying to load a date. Specifying the child element of :
Prepares an insert statement where the date is a string causing issues with oracle 10g. I changed the prior to:
Which allows the load data task to take an alternate branch, which calls (line 120:
valueConfig.setValueDate(value.toString());
). However, now the insert statement does not get setup with quotes, nor a to_date function wrapped around it. So I replaced in my csv data with the JDBC ts escape and it now works fine.
Sample data:
ID,THENAME
1,{ts '2011-01-01 00:00:00.0'}
Now I just need to export all my data with {ts} and/or {d} escapes. ;)
-David