Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using LOAD DATA INFILE to import multiple csv files into MySQL database, for this I use a bash script. Now I want to log all the errors to log file or STDOUT which occurs while loading the files into databse. I am able to get the warnings while loading into a STDOUT file, which eventually loads into log file.

I want to achieve the following things

1) I want to capture number of records loaded into databse 2) I want to capture the csv file name details, and error details

Below is the load data infile command used inside the bash script

load data local infile $APOSTROPE$DIR_STAGING$FILE_TR_HI_MASTER$FILE_EXTEN$APOSTROPE into table $TRANS_TABLE fields terminated by '$COLUMN_DELIM' lines terminated by '$UNIX_LINE_DELIM' (PROGRAMAMOUNT,@ENTRY_DATETIME,) SET ENTRY_DATETIME=STR_TO_DATE(@ENTRY_DATETIME,'$DATE_FORMATTER'); SHOW WARNINGS;

Please help me

Thanks

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.