On 6 Feb 2011, at 5:42pm, David M. Cotter wrote: >> If you don't need this behaviour because you're confident you'll never get a >> clash, then you could accumulate your INSERTs in memory, then blast through >> them when you would previously have just done the COMMIT. > > > i will never have a clash because i manage the primary keys myself. > is there an SQL way to do that or do you mean i should build my own struct to > hold the data temporarily?
Sorry, no automated way to do it. You'll have to do it yourself. If, for example, you're using sqlite3_exec() and just handing it a SQL string that starts "INSERT INTO ..." then you could make an array, store these strings in it as you're preparing them, and just flush the array to your database when you have 100 (or 1000) of them. This will lock up your database for less time because you won't be holding it locked while you prepare the SQL commands, just enough time to retrieve them from an array. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users