I have an application that imports a CSV file into a MySQL table where all fields are varchar type. One field has a date in the format 'MM/DD/CCYY hh:mm' where leading zeroes are typically not present. This needs to be converted to something that MySQL will swallow - such as: 'CCYY-MM-DD hh:mm:ss' where all zeroes are required.
I can get the various parts of the time using split and then rebuilding the string. BUT there are typically somewhere between 7000 and 500000 records in the table.
I am assuming that doing a SELECT and getting the key and the date as text field into a HASH - then convert the date format - the do an UPDATE will be the best way of doing the change?
App is in Perl 5.8.0 using DBI/DBD-MySQL.
Your advice is sought on
In reply to Convert date format in database table. by jdtoronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |