On 24/01/2009 5:09 AM, Onion Knight wrote:

>       "UPDATE tags SET lft = CASE WHEN lft BETWEEN ? AND ?"
>       "       THEN lft + ? ELSE lft + ?"
>       "END WHERE lft BETWEEN ? AND ?",

Two suggestions:

(A) Check to see if the corresponding SELECT works:

"SELECT *, CASE WHEN lft BETWEEN ? AND ?"
"    THEN lft + ? ELSE lft + ?"
"END FROM tags WHERE lft BETWEEN ? AND ?",

(B) Note that the effect of C's compile-time concatenation of string 
literals means that that you end up with:

"... ELSE lft + ?END WHERE ..."
not "... ELSE lft + ? END WHERE ..."

The former case should just work, or (much less preferably) give an 
error return. However it's cheap to add a space and run it again to see 
if you've stumbled on a weird dark-corner-case bug.

Try (A), (B) and (A+B)

HTH,
John



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

Reply via email to