[sqlite] Multiple prepared statements

2010-10-15 Thread Andrew Davison
In my database I do lots of inserts, of exactly the same nature so I use a prepared statement, which I cache, always reseting after use. Works fine. Now I decide that I want a second type of insert, so I try to use a prepared statement for that as well. However it always fails. As long as the

Re: [sqlite] Multiple prepared statements

2010-10-15 Thread P Kishor
On Fri, Oct 15, 2010 at 8:43 AM, Andrew Davison andrew.davi...@gmail.com wrote: In my database I do lots of inserts, of exactly the same nature so I use a prepared statement, which I cache, always reseting after use. Works fine. Now I decide that I want a second type of insert, so I try to use

Re: [sqlite] Multiple prepared statements

2010-10-15 Thread Pavel Ivanov
Now I decide that I want a second type of insert, so I try to use a prepared statement for that as well. However it always fails. As long as the other prepared statement is hanging round I can't prepare a new one. Does this seem right or am I really soing something wrong? You are doing

Re: [sqlite] Multiple prepared statements

2010-10-15 Thread Andrew Davison
On 15/10/2010 11:49 PM, Pavel Ivanov wrote: Now I decide that I want a second type of insert, so I try to use a prepared statement for that as well. However it always fails. As long as the other prepared statement is hanging round I can't prepare a new one. Does this seem right or am I really

Re: [sqlite] Multiple prepared statements

2010-10-15 Thread Andrew Davison
Yup, my bad. Fixed. On 16/10/2010 12:03 AM, Andrew Davison wrote: On 15/10/2010 11:49 PM, Pavel Ivanov wrote: Now I decide that I want a second type of insert, so I try to use a prepared statement for that as well. However it always fails. As long as the other prepared statement is hanging

[sqlite] Multiple prepared statements

2008-11-26 Thread Oyvind Idland
Hi, according to documentation, An application is allows to prepare multiple SQL statements in advance and evaluate them as needed. There is no arbitrary limit to the number of outstanding prepared statements. I am using two prepared statements in my code (that does INSERT), following the

Re: [sqlite] Multiple prepared statements

2008-11-26 Thread Igor Tandetnik
Oyvind Idland [EMAIL PROTECTED] wrote: I am using two prepared statements in my code (that does INSERT), following the pattern prepare(stmt1) prepare(stmt2) while (xx) { bind(stmt1) step(stmt1) reset(stmt1) bind(stmt2) step(stmt2) reset(stmt2) } The first iteration works,

Re: [sqlite] Multiple prepared statements

2008-11-26 Thread Oyvind Idland
*argh* more or less my bad, sqlite3_prepare_v2() instead of sqlite3_prepare() solved it. Oyvind. On Wed, Nov 26, 2008 at 5:29 PM, Igor Tandetnik [EMAIL PROTECTED] wrote: Oyvind Idland [EMAIL PROTECTED] wrote: I am using two prepared statements in my code (that does INSERT), following

Re: [sqlite] multiple prepared statements with INSERT?

2006-12-23 Thread Jay Sprenkle
On 12/21/06, E Tse [EMAIL PROTECTED] wrote: Hi guys, I ran into a strange problem. I have 2 prepared sqlite3_stmt, each inserting to different tables in a sqlite database: sqlite3_stmt* insertA; std::string sql = insert into tablea(col1) values(?); int rc = sqlite3_prepare(db_, sql.c_str(),

[sqlite] multiple prepared statements with INSERT?

2006-12-21 Thread E Tse
Hi guys, I ran into a strange problem. I have 2 prepared sqlite3_stmt, each inserting to different tables in a sqlite database: sqlite3_stmt* insertA; std::string sql = insert into tablea(col1) values(?); int rc = sqlite3_prepare(db_, sql.c_str(), sql.size(), insertA, NULL); sqlite3_stmt*

[sqlite] Multiple prepared statements work on Windows... fails on Mac OS X

2006-04-13 Thread Slater, Chad
Hello, I'm using two prepared statements in a block of cross platform C++ code like this (very roughly): { sqlite3_stmt * pstmt1 = NULL; sqlite3_stmt * pstmt2 = NULL; pstmt1 = PrepareAndBind(...); // Prepare and bind one statement pstmt2 = PrepareAndBind(...); // Prepare