How to import date type from csv ?

BubikolRamios's profile image BubikolRamios posted 8 years ago in General Permalink

"x","x","x","1.8.2008","x"

I thought I couuld copy generated insert sql (& add STRTODATE), but no it is snipped of.

?

BubikolRamios's profile image BubikolRamios posted 8 years ago Permalink

OK, preferences - turn off snip off, but anyway it looks like it eats date directly.

kalvaro's profile image kalvaro posted 8 years ago Permalink

I don't think HeidiSQL offers any feature for that, you'll possibly have to write a LOAD DATA statement yourself so you can compose a SET clause. There're some user comments that explain how to do so in the MySQL manual page.

BubikolRamios's profile image BubikolRamios posted 8 years ago Permalink

OK, preferences - turn off snip off, but anyway it looks like it eats date directly.

Yeah. eats it directly, sometimes, but what comes out in db is totaly unpredictable. i.e. date you send in becomes date in database but not same date as you send in.

There, for example, you have two red marked fields.

First is type date time, heidi should warn about that, if cheched, the simplest way upon 'Import!' button click, bring up input dialog box where user input format thta fits into this func: STR_TO_DATE(yourdatefield, '%m/%d/%Y')

Second is type of timestamp, should be shown, but be default checked of & disabled.

Please login to leave a reply, or register at first.