Am 01.02.2006 um 17:10 schrieb deBooza (sent by Nabble.com):



Hi

I'm using sqlite in a c++ program, using functions sqlite3_open, sqlite3_exec, sqlite3_close etc.

I am trying to import a lot of data, probably around 100,000 rows+. I have found it
quicker if I format the data into SQL statements and then use
the shell statement .read to read in the SQL from file and
populate the database, similar to the following:

 .read c:\tmp\sql.txt

While this is a solution it's not an ideal one. I would much
prefer to do it programatically, something like this:
void main()
{
        while(not end of data)
        {
                Write data to file
        }
        
        ExecuteSQLFromFile( SQLFile )
}

Does anyone know how to do this?

What is the equivelent to .read?

Or does anyone know of a better way?

The code for the sqlite commandline is in shell.c in the sqlite source distribution, so you could just grab the code that handles '.read' from there...

Reply via email to