Reputation: 53
I am trying insert data into the netezza box. I have a pipe-delimited file wherein I want multiple variations of 'none'(i.e. 'None', 'NONE','none') be treated as NULL. While '-nullvalue' option does work for one variation at a time it doesn't allow me to set multiple variations to be treated as NULL.
Moreover multiple dfinition of the nullvalue option in the cf too doesn't help
Upvotes: 1
Views: 775
Reputation: 3887
As of version 7.2, nzload does not allow multiple values for the -nullvalue option. However, the 4 character value that you can specify is case insensitive, which allows for your particular sample case of -nullvalue of 'None' to match with 'NONE', 'none', 'NoNe', etc.
TESTDB.ADMIN(ADMIN)=> create table null_test (col1 int, col2 int, col3 int);
CREATE TABLE
$ cat test.txt
1|NONE|1
2|None|2
3|NoNe|3
$ nzload -db testdb -df test.txt -t null_test -delim \| -nullvalue 'None'
Load session of table 'NULL_TEST' completed successfully
TESTDB.ADMIN(ADMIN)=> select * from null_test where col2 is null;
COL1 | COL2 | COL3
------+------+------
1 | | 1
2 | | 2
3 | | 3
(3 rows)
Upvotes: 1