Hello,
I saw several other posts complaining about simialr issues, however did
not find a solution that worked for me.
My program gets an input file from a 3rd party (which I cannot modify)
The file is TAB separated, and in addition values are often surrounded by
double quotes.
I use CSVREAD function to import that file as an H2 database table. The
problem is that downstream logic depends on empty strings (represented as
"" between tabs in the input file) to be converted to NULL, but they are
imported as empty strings.
Specifying nullString="" does not work. I tried a number of things,
includin CHAR(34) etc.. .nothing works.
Looks like a bug?
Here are my test statements that work with the attached sample input file.
-------
DROP TABLE IF EXISTS sample_table;
CREATE MEMORY TABLE IF NOT EXISTS sample_table
AS SELECT * FROM CSVREAD('sample_tsv_with_double_quotes.csv',null,
STRINGDECODE('caseSensitiveColumnNames=true charset=UTF-8 nullString=""
fieldSeparator= '));
SELECT * FROM sample_table ;
-------
All "" values are imported as empty strings instead of nulls :(
Sample input file is attached!
Thank you!
Oleg
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/h2-database/-/vjw5dXW2SfUJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.
Campaign Campaign Daily Budget Languages Geo Targeting Ad Group Max CPC Max Content CPC Placement Max CPC Max CPM Max CPA Keyword Keyword Type First Page CPC Quality Score Headline Description Line 1 Description Line 2 Display URL Destination URL Campaign Status AdGroup Status Creative Status Keyword Status Suggested Changes Comment
"onestop-hobo_bags-products-ps" "0.00" "en" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Abbey Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Aces Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Aggie Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Aggie Wallets: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo AimToFreeze Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Alda Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Alda Wallets: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Alicia Clutches: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Alicia Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Ally Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Ally Wristlets: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Alton Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Amica Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Amica Wallets: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Ana Clutches: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Ana Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Angela Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""
"onestop-hobo_bags-products-ps" "" "" "" "Hobo Angelica Handbags: Model" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Active" "Active" "" "" "add" ""