Developer forum

Forum » Development » Empty dates in import

Empty dates in import


Reply

I am using the DB Integration module to import data from a csv file into a customtable in the Dynamicweb database. In the table there are some colums of type Datetime and these colums is set to allow null values. But the DB Integration won't import empty dates into these colums! I get this error:

 

Insert Row: 1 Exception: String was not recognized as a valid DateTime.Couldn't store <> in Frist_for_aflevering_af_tilbud Column. Expected type is DateTime

 

Is it not possible to import blank dates using the DB Integration module? I would expect blank dates to be imported as null values into the database.

 

Regards

Lars

 


Replies

 
Nicolai Høeg Pedersen
Reply
lal@dkis.dk wrote:

I am using the DB Integration module to import data from a csv file into a customtable in the Dynamicweb database. In the table there are some colums of type Datetime and these colums is set to allow null values. But the DB Integration won't import empty dates into these colums! I get this error:

 

Insert Row: 1 Exception: String was not recognized as a valid DateTime.Couldn't store <> in Frist_for_aflevering_af_tilbud Column. Expected type is DateTime

 

Is it not possible to import blank dates using the DB Integration module? I would expect blank dates to be imported as null values into the database.

 

Regards

Lars

 

Hi Lars
 

 

The DB integration has a design decision that makes sure that empty fields are "" so you will not get a "Field does not accept null" error when importing. Of course this gives problems with dates and probably also numeric field types.

 

So the answer to your question is no.

 

You must be logged in to post in the forum