We have a requirement to load the data from a table to a csv file. CSV file should be in delimited format with quotes as text separator. And Dates should not be enclosed by quotes.
I have implemented this using IKM SQL to File Append IKM with headers option to yes. And by using ODIOutFile to create a file.
but, i am getting multiple errors.
1. If we have a column of Numeric datatype, Row Header was not generated. But data gets loaded.
2. If we have a date column, throwing error
3. If i made all columns as string type - all columns data was enclosed in quotes.
cant we have data types for a csv file?
can anyone please help me on solving this.
Take the data type as string for all column in your file datastore.
Now append " quote in mapping expression for those column except the date and number column in I$ table.
Dont use the text delimiter in your file data store.
Thanks for your reply.
It worked great.
can you suggest me any other way, may be by changing code in IKM or any other way of implementing this. Coz, This solution seems like we are hardcoding the quotes.
Edited by: BMK on Feb 1, 2013 11:47 AM
I dont think it will be considered as hardcoding because this is not a dynamic value. Its is just a quote. Where ever you provide, its going to be constant thought out the process whether it is given in text delimiter or in mapping tab. Again you need this only for varchar type column not for number or date.
And there is always alternative for every question. But i dont think other alternative (by writing a special KM or some jython code etc ) will be easier than this.
Let me know if you get something.