Need a program to create MySQL statements based on CSV file as follows:
How to Run:
Input: <<Input CSV File Name>>, <<Output MySql Statements File Name>>, <<Input Id Field Name>>, <<Input Create Date Field Name>>, <<Input Modify Date Field Name>>, <<Table Name>>, <<Output Id Field Name>>, <<Output Create Date Field Name>>, <<Output Modify Date Field Name>>
E.g. YourProgram [url removed, login to view] [url removed, login to view] “Id” “CreatedDate” “LastModifiedDate” “accounts” “date_entered” “date_modified”
Your Program is supposed to the following:
Skip the header from .csv file and user the header to locate the input Id, Create Date and Modify Date fields.
Go thru each row
Create update statement based on arguments passed (e.g. update accounts set date_entered = XXXXX, date_modified = YYYY where id = ZZZZZ;)
You may have to use some format function to make the date format suitable for mysql.
Output to outfile.
End of loop
Flush the buffer s to make sure output file is not truncated.