Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

MySQL INFILE CSV

I am trying to use the INFILE MySQL function to upload a large CSV file (2GB) into a MySQL database.

INFILE is faster than looping through each row, so I want to try get INFILE to work. The bottom script works in Qlikview - so why not in Qlik Sense?

So far...

First hurdle was that the "MySQL Enterprise Edition" Data connection can only read from our MySQL Community Edition. Using drop / truncate / create commands results in the error: (Most command actually executed if you ignore errors)

"QVX_UNEXPECTED_END_OF_DATA: Unable to get column information for the fields that are used in the query: Object reference not set to an instance of an object."

The errors were fixed by using the ODBC connection setup for Qlik Sense:

https://withdave.com/2017/04/connecting-to-mysql-community-edition-with-qlik-sense-system-dsn-with-m...

But INLINE still gives an error. This time:

"Connector reply error: SQL##f - SqlState: S1000, ErrorCode: 1148, ErrorMsg: [MySQL][ODBC 8.0(w) Driver][mysqld-5.5.49-log]The used command is not allowed with this MySQL version"

I also tried using OLE DB with the ODBC connection, but I get an error.

"Connector reply error: ErrorSource: Unknown source, ErrorMsg: Unknown description"

I tried different path references, but without luck.

  • "D:/QlikData/QSData/Temp/Test.csv"
  • "D:\\QlikData\\QSData\\Temp\\Test.csv"
  • referencing the csv file path on the qlikview server

Qlikview Script:

 

ODBC CONNECT TO MySQL;

SQL
LOAD DATA LOCAL INFILE "//QS_Server/QSData/Temp/Test.csv"
INTO TABLE Test_DB.Test_Table
COLUMNS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '"'
LINES TERMINATED BY '\r\n' 
IGNORE 1 LINES;

Any other ideas ?

 

 

Labels (2)
0 Replies