MySQL Forums
Forum List  »  Newbie

Re: Load Zulu date/time into datetime ?
Posted by: Karl Bresele
Date: April 04, 2021 01:51AM

Thanks Peter,

fresh day - fresh brain

I dropped the fourth column which was supposed to be used for staging but is no longer needed.

Here is my (your ;o) ) solution which works well.

SET GLOBAL local_infile=1;
LOAD DATA LOW_PRIORITY LOCAL INFILE 'P:\\test.txt' REPLACE INTO TABLE `um`.`test2` CHARACTER SET UTF8MB4
FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' IGNORE 1 LINES
(@d, sensor_id, sensor_type)
SET DATETIME = str_to_date( @d, "%Y-%m-%dT%H:%i:%SZ" )

This made my day

Options: ReplyQuote


Subject
Written By
Posted
Re: Load Zulu date/time into datetime ?
April 04, 2021 01:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.