RyanBower
RyanBower

Reputation: 107

Netezza nzload error: Day is zero

I am using NZLOAD to load a massive .csv file into a netezza machine. This .csv is a 30GB extract from an older database, so updating the formats is a challenge.

I have a field in the database that is causing problems. The field represents the date that a customer performed some action. Because most customers have not performed the action, they have null values. NULL values for this field default to "0000-00-00 00:00:00".

The following error (not surprisingly) results:

1: 2(222) [22, TIMESTAMP] day is zero, ""0000-00-00"[ ]

Do you have any suggestions for working around this error?

Upvotes: 1

Views: 301

Answers (1)

Niederee
Niederee

Reputation: 4295

  1. Create a table where the datatype of the field in question is varchar(30)
  2. nzload to the new table
  3. Insert into the table the existing table with a case statement:

Select cast(case when textfield = '0000-00-00 00:00:00' then null else textfield end as timestamp) from new table

Upvotes: 1

Related Questions