Hi,
what is the correct syntax to use for WHERE expression:
if (sqlite3_exec(test_db, "CREATE TABLE ana_db (item1 integer, item2
integer, item3 integer, item4 integer, item5 integer);", NULL, 0, NULL))
sqlite_error(test_db);
// create index
if (sqlite3_exec(test_db, "CREATE INDEX item1idx ON ana_db (item1);", NULL, 0,
NULL))
sqlite_error(test_db);
// insert values for 1000 records
for (ii=0; ii< 1000; ii++)
{
if (error_code = sqlite3_exec(test_db, "INSERT INTO ana_db VALUES
('ii', 1, 0, 1, 100);", NULL, 0, NULL))
{
sqlite_error(test_db);
return (-1);
}
}
// update values for 1000 records
for (ii=0; ii< 1000; ii++)
{
if (error_code = sqlite3_exec(test_db, "UPDATE ana_db SET
item2=item2+1 WHERE item1='ii';", NULL, 0, NULL))
{
sqlite_error(test_db);
return (-1);
}
}
It looks like I'm not using the right syntax in UPDATE statement, I tried with:
WHERE item1 = $ii, w/out success.
What am I doing wrong?
Thanks,
NK