you don't need to prepare when you use exec...

The following is not a step.. Don't see how this even would compile...

while(sqlite3_prep(plineInfo) == SQLITE_ROW) 

--- On Fri, 10/10/08, Shaun R. <[EMAIL PROTECTED]> wrote:

> From: Shaun R. <[EMAIL PROTECTED]>
> Subject: [sqlite] database is locked
> To: sqlite-users@sqlite.org
> Date: Friday, October 10, 2008, 3:30 PM
> I have some code that i'm having problems with.  i open
> the database, 
> prepare, and the step through.  During each step i'm
> trying to run a 
> seperate exec which is attempting to update a row.  I keep
> getting a error 
> that says database is locked.  I tried creating a
> additional open to just 
> use on the updates but i get the same error.  Short example
> below with no 
> error checking.
> 
> 
> 
> sqlite3_open("my.db", &db);
> 
> sqlite3_prepare(db, "SELECT ip_address FROM ips WHERE
> ip_owner=''", 
> &plineInfo, 0);
> 
> while(sqlite3_prep(plineInfo) == SQLITE_ROW) {
> 
>    zSQL = sqlite3_mprintf("UPDATE ips set
> ip_owner='%q' WHERE ip_owner='' 
> and ip_address='%q'", username,
> sqlite3_column_text(plineInfo, 0));
> 
>     sqlite3_exec(db, zSQL, 0, 0, 0) == SQLITE_OK);
> 
> }
> 
> Agian this is just a quick/basic example showing what
> i'm trying to do.  I 
> keep getting database is locked when checking the error
> returned by exec.
> 
> ~Shaun 
> 
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to