-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

yoky wrote:
>      I create a table include about 200 columns,

http://en.wikipedia.org/wiki/Database_normalization

> 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().

Use bindings.  Instead of the values put in ?.  (You can also use
numbers such as ?7 or names such as :name1 or $name2).

You only need to call sqlite3_prepare once.  Then on each run call
sqlite3_reset which sets all bindings to null.  Use
sqlite3_bind_parameter_count to find out how many bindings there are,
sqlite3_bind_parameter_name to get the name of a binding or
sqlite3_bind_parameter_index to get the number of a named binding, and
finally sqlite3_bind functions to bind values as appropriate:
http://www.sqlite.org/c3ref/bind_blob.html

(Also using sprintf/strcat is almost a guarantee that you will
eventually have buffer overruns or SQL injection attacks.)

> 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.

The easiest solution is to get a decent development environment :-)  If
you have to use one with issues like that then stripping the comments
from the source will give you a file smaller than 65535 lines.  See the
attachment at the bottom of
http://www.sqlite.org/cvstrac/tktview?tn=3344 for a small program that
will do that.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkkBBsMACgkQmOOfHg372QS20wCfZDLIhLigXaa8NGiDV/dg3BMv
inQAnj9J3xvrTM7oydMrbaxP8igsYXRR
=FQGf
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to