>> Actually I was wanting to put that into a program.
> I don't know how I guessed that but I'm feeling really smug now. I'm feeling very amused by your smugness ;-) >> So, is there an API or query I can run to load an sql file all in one go >> (one transaction) without having to read in the file manually and query one >> line at a time? > No, sorry. That's what programming languages are for. Open the file, read a > line, execute it using sqlite3_exec(), read the next line, execute that, > etc.. It shouldn't be much more than a five line loop. Don't forget to trap > errors. Guess I'll adapt some existing code then to wrap all the lines sent in one big transaction. > Of course, sqlite3_exec() can execute multiple commands in one go. So you > could open the file, read the whole thing into one huge string, close the > file, then execute the string. That will work perfectly if your have enough > memory and disk space. But if you aren't confident about the size of the > text file before you start, it's probably better to do it line by line. Most of the sql files probably are ok with that approach, but others not so much. Maybe a hybrid approach ... small files all in one go, big ones broken up. > Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users