yoky <[EMAIL PROTECTED]> writes: > > Hi all, > I create a table include about 200 columns, before insert a record to > this table, I use sprintf() and strcat() to build a very very long SQL > statement > like "insert into tablename (Field1,Field2,Field3,...........) values > (Value1,Value2,Value3.............)" ,and it's length is more than 4000, > Then invoke > sqlite3_prepare() and sqlite3_step(). > Test the time use of insert one record, I found that most of insert > time was occupied by sqlite3_prepare(), and it costs about 60ms in my > embedded system. > Are there some useful methods to improve the efficiency of insert one > record? > And there is a little tips about debug with Microsoft VS2005. When the > number of lines of a source file is more than 65535, the Debugger may out > of action. > For example, sqlite3_prepare() is begin at the line of 66632 in sqlite3.c , > the Debugger can not step into this function, but sqlite3_exec() in 63534 > line it works normally. > > Thanks > yoky
I find it hard to believe that you require a single DB row with 200 cols! If you are just looking up 200 different named values there are better ways to do that, e.g. http://en.wikipedia.org/wiki/Berkeley_DB . The power of SQLite (and why it's worth taking time doing a _prepare()) is when you want to do relational queries. Then, once you have done a _prepare() on your SQL, you bind the values and do a _step(): much quicker for multiple updates ... read the documentation ( http://www.sqlite.org/c3ref/bind_blob.html ) Regards, MikeW _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users