SQL will not do the trick for me because I based on the select I have to
perform other operations(queries on other tables) and only then can I update
the table in question.

Kees Nuyt wrote:
> 
> There is no need to do this in a loop with a cursor.
> Whenever possible, use the power of SQL set operations.
> As far as I can tell, an alternative solution to
> your problem could be (pseudocode):
> 
> delSql = "UPDATE table1
>    SET ghi = ?
>  WHERE def IN (
>       SELECT ref 
>         FROM table1
>        WHERE abc = ?
>       );";
> prepare(db, delSql, ..., stmt, ...);
> bind_int(stmt, ..., ghivalue);
> bind_text(stmt, ..., abcvalue);
> step(stmt);
> reset(stmt);
> finalize(stmt);
> 

-- 
View this message in context: 
http://old.nabble.com/sqlite3_step-to-select-and-update-the-same-table-tp30152284p30166069.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to