Thiago Mello wrote:
BEGIN TRANSACTION;
SELECT id,name FROM TABLE1;
/* now in the callback function */
IF argv[1] = "JOHN";
UPDATE TABLE1 SET number=n+1 WHERE id=X
/* return from the Callback function */
END TRANSACTION;
But I still get a error: "database table is locked".
Is still something wrong that Im doing?
SQLite does not allow you to read and write the
same table at the same time. You need to finish the
read of TABLE1 before you start changing it. Perhaps
like this:
BEGIN;
CREATE TEMP TABLE t1 AS SELECT id,name FROM table1;
SELECT id,name FROM t1;
/* Now in the callback function */
UPDATE table1 SET number=n+1 WHERE id=X;
/* Return from callback function
DROP TABLE t1;
COMMIT;
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]