Ah! I haven't written a blog for a long time. Today to migrate some data from Oracle to MySQL, a regular replacement for the transformation of time, hoping to help needy friends. Insertion time in 1.mysql http://bbs.csdn.net/topics/380234140 mysql to format the insertion time for example insert into users (birth) VALUES (str_to_date (' "+ alarmdefi.getendtime () +" ', '%y-%m-%d%k:%i:%s '));
This allows you to insert the year-month-day time: minutes: seconds
Example: INSERT into Im_sm_evaluation (NAME, CODE, VAL, Host_tel, Descriptioin, Create_man, Create_time) VALUES (' Very satisfied ', 1, NULL , 13452, NULL, NULL, Str_to_date (' 2014-12-30 19:29:20 ', '%y-%m-%d%k:%i:%s '); 2. Scripts from Oracle Insert time are converted to MySQL Insert time script: Oracle script, script exported using Plsql's Export Data feature: INSERT INTO Im_sm_evaluation (NAME, CODE, VAL, Host_tel, Descriptioin , Create_man, Create_time) VALUES (' Satisfied ', 2, NULL, 13601, NULL, NULL, To_date (' 15-04-2015 15:54:55 ', ' dd-mm-yyyy hh24:mi:ss Insert into Im_sm_evaluation (NAME, CODE, VAL, Host_tel, Descriptioin, Create_man, Create_time) VALUES (' Unsatisfied ', 3, NULL , 13601, NULL, NULL, To_date (' 15-04-2015 15:54:55 ', ' dd-mm-yyyy hh24:mi:ss '); Replace with regular: To_date (' 31-12-2014 19:29:20 ', ' dd-mm-yyyy hh24:mi:ss ') str_to_date (' 31-12-2014 19:29:20 ', '%d-%m-%y%k:%i:%s ') /* note%d and%Y replace position, Does not affect the last insertion effect */ Regular: To_date\ ((. *), ' dd-mm-yyyy hh24:mi:ss ' \) str_to_date\ ($, '%d-%m-%y%k:%i:%s ' \) For large quantities brought into the migration has great use! I do this using the regular functionality of the notepad++.
2015-05-27 using regular to convert Oracle time to MySQL time