I have the following to import from a .csv
Code:Dim bl As New MySqlBulkLoader(conn) bl.TableName = "elektrisiteit_staging" bl.FieldTerminator = "," bl.LineTerminator = "\r\n" bl.FileName = DataFilesInvoer & "Eskom - Consumption History.csv" bl.NumberOfLinesToSkip = 3 bl.FieldQuotationCharacter = """" Try conn.Open() Dim count As Integer = bl.Load() '' MsgBox("Inside try") conn.Close() Catch ex As Exception MessageBox.Show(ex.ToString()) End Try
The date column in the csv is in format 25-04-2021. Importing it in MySQL gives an error : incorrect date value '25-04-2021'. I understand the issue. MySQL takes a different date format. Although searching and trying everywhere, I just cannot figure out how to change the bulkloader.
I know I should be using something like :
Code:(@Datum,TimeOfUse,UnitsOfMeasurement,Verbruik,EnergyCharge) SET Datum = STR_TO_DATE(@Datum, '%d-%m-%Y')
But how?
Regards




Reply With Quote
