Search code examples
mysqlsqlarraysdelphizeos

How to transfer a multidimensional array to a MySQL table (through Zeoslib)?


I am using the Zeoslib library in Delphi.

I have a large multidimensional static array that I need to transfer to an empty table in a local MySQL database. How can I do this efficiently?

Just iterate through a million insert statements?


Solution

    1. You can use MySQL syntax: INSERT INTO tab VALUES (v11,..., v1n), ..., (vm1, ..., vmn). IOW, you can collect your array rows into chunks consisting of M rows. This will seriously improve performance. (More)
    2. You can offload array into text file, then use LOAD DATA INFILE statement to load text file efficiently. (More)
    3. You can consider to use other 3d party libraries, like AnyDAC. Which implements Array DML feature, which is intended exactly for your task. (More)