2015-05-27 convert Oracle time to MySQL time with regular

Source: Internet
Author: User
Tags mysql insert

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.