0

I have this pattern 27-FEB-17 in a csv file. how can i keep this format on mysql using DATE and not CHAR?

!/bin/bash

mysql --user= --password= --local_infile=1 models -e "LOAD DATA LOCAL INFILE '/home/27022017.csv' INTO TABLE test FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' ignore 1 lines"

thank's

1 Answer 1

0

MySQL DATE type format is YYYY-MM-DD. You can't keep that formatting under the DATE type.

If your goal is not to iterate and transform the dates formatting you could look into triggers to post-process the string values into a proper DATE

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.