c++ - Syntax error in SQLite query -
i trying insert large number of records sqlite database. above error if try use sqlite3_exec c-api.
the code looks this:
ret = sqlite_exec(db_p,".import file.txt table", null, null, null);
i know .import command line, can there way can extremely large insert of records takes minimal time. have read through previous bulk insert code , attempted make changes these not providing desired results.
is there not way directly insert string tables without having intermediate api's being called?
.import not available via api. there's 1 crucial thing speed inserts: wrap them in transaction.
begin; lots of insert statements here; commit;
without this, sqlite need write file after each insert keep acid principle. transaction let's write file later in bulk.
Comments
Post a Comment