Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-27 Thread Bella Chan
qlite3 source. Thanks, Bella -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Marian Cascaval Sent: Wednesday, January 26, 2011 7:26 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] how to create sqlite3_value str

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Bella Chan
FYI, I finally figured out why it is slow with C because I need to turn off autocommit, it is now lightning speed :) Thanks, Bella ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Bella Chan
> Parameters are numbered from 1, not from 0. Your first sqlite3_bind_int > call fails; the second binds a value for function_id column; the > parameter for function_name retains its initial value of NULL. The > insert then runs afoul of NOT NULL constraint. Ah, that fixed it. Thanks much. Bel

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Igor Tandetnik
On 1/26/2011 7:48 PM, Bella Chan wrote: > I got "19 constraint failed" error from this code: > > "CREATE TABLE functions (" > "function_id integer PRIMARY KEY," > "function_name integer not null" > ");\n" > > > sqlite3_bind_int(statement,0,i); > sqlite3_bind_int(statement,

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Bella Chan
> Incorrect. You can bind_int or bind_int64 on an integer primary key column > just like any other column. > What does sqlite3_errcode(db) and sqlite3_errmsg(db) say after you run > sqlite3_step(pStmt) on the above? I got "19 constraint failed" error from this code: "CREATE TABLE functions (" "

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Richard Hipp
On Wed, Jan 26, 2011 at 6:53 PM, Bella Chan wrote: > I want to confirm that it is true that I can't do bind_int on integer > primary key. > Incorrect. You can bind_int or bind_int64 on an integer primary key column just like any other column. > > If I do "insert into functions values(?,?)" an

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Bella Chan
qlite3 source. Thanks, Bella -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Marian Cascaval Sent: Wednesday, January 26, 2011 7:26 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] how to create sqlite3_value str

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Marian Cascaval
Sent: Wed, January 26, 2011 2:51:38 PM Subject: Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()? Bella Chan wrote: > I am surprised to see that C is slower than Perl when inserting lots of data >into DB sequentially as I have 100 columns in a row >

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Igor Tandetnik
Bella Chan wrote: > I am surprised to see that C is slower than Perl when inserting lots of data > into DB sequentially as I have 100 columns in a row > so I have been making 100 bind_int calls while Perl I only need to do execute > once. You are doing something wrong. Are you re-preparing the

[sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Bella Chan
I am surprised to see that C is slower than Perl when inserting lots of data into DB sequentially as I have 100 columns in a row so I have been making 100 bind_int calls while Perl I only need to do execute once. Trying to see if I can use bind_value() instead but no clue ho to create the sqlit