I have the following code:
int rc;
rc = sqlite3_exec(sqlite3_database, ".import mydata.csv mytable", callback, 0, &errMsg);
After this gets run, errMsg contains this error message:
near ".": syntax error
I assume that it does not recognize the import command. However, this command works when running it from the sqlite3 program on the command line.
I need to be able to use the import command directly in my program. Is there a way I can do this? The reason I need to use the import command is because doing inserts for each line of the CSV file takes over 5 minutes, and the import command takes a split second.