MySQL Forums
Forum List  »  Newbie

Re: Importing issues
Posted by: Peter Brawley
Date: March 22, 2016 12:59PM

> I'm wondering if it's possible for MySQL to auto add a primary key during the import process.

No, and that would be a design error. A table isn't a real table without a primary key, and the time to create it is when the table is created.

> The date is recorded as DD-MM-YYY, and the MySQL format is YYYY-MM-DD.
> Is it possible at all to get MySQL to recognize any other format?

Not for storage. Use str_to_date() to massage non-compliant date values, eg ...

load data infile ...
...
( ... @mydatevar ...)
...
set mydatecolname=str_to_date(@mydatevar, "%d-%m-%Y");

Options: ReplyQuote


Subject
Written By
Posted
March 22, 2016 12:38PM
Re: Importing issues
March 22, 2016 12:59PM
March 28, 2016 11:31AM
March 28, 2016 11:48AM
March 28, 2016 11:51AM
March 28, 2016 12:08PM
March 23, 2016 06:47AM


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.