MySQL加载文件无法按预期工作

时间:2017-09-14 19:44:00

标签: mysql vb.net

我在我的文件中有这些数据(有时字段可能是双引号),如下所示:

1, "ala",   johnes, 2017-09-01, 100
2, dqwdqdq,, 2017-09-01, 101

数据已加载到数据库,但引号也会插入到列中,因此要查看ala我在列中看到"ala"

我的代码:

    Using exclecon As New MySqlConnection("Server=Localhost;DataBase=mobily;user=root;password=897;")
        Dim uploadQry As String = "Load DATA LOCAL INFILE 'C:/Users/Robert/Desktop/test.csv' INTO TABLE Test FIELDS TERMINATED BY ',' ENCLOSED BY '""' ESCAPED BY '' LINES TERMINATED BY '\r\n' IGNORE 0 LINES;"
        Dim myCUpload As New MySqlCommand(uploadQry, exclecon)
        exclecon.Open()
        myCUpload.ExecuteNonQuery()
    End Using

0 个答案:

没有答案