LOAD INFILE with NULL doesn't work?

1 post / 0 new
vaultec
vaultec's picture
Offline
Last seen: 1 year 7 months ago
Joined: Jun 23 2012
Junior Boarder

Posts: 3

Hans Steinmann
LOAD INFILE with NULL doesn't work?

Hi everybody!

I'm acctually changing my application from inserting data via sql transactions to load via INFILE. (I need # as delimiter.) I thought that two delimiters in a row are loaded as a null value. So I created the file and executed

[code]LOAD DATA INFILE '/mnt/trans/txt.txt' INTO TABLE tab FIELDS TERMINATED BY '#' LINES TERMINATED BY 'n'[/code]

And the result:

[code]Error: Incorrect integer value: '' for column 'CALDAY' at row 1
SQLState: HY000
ErrorCode: 1366[/code]

I also tried to set NULL to the column, with result, that NUL is not a valid integer value. I have no Idea how to load NULL values via INFILE... or did I miss something in the manual?

Greetings!
vaultec