> for value in "SELECT main_column IN mytable":
>   UPDATE mytable SET other_column='foobar' WHERE main_column=value

Exactly this sequence is safe. Things can go nuts in case if you have
index on other_column and you do something like this:

for value in "SELECT main_column IN mytable WHERE other_column='something'":
  UPDATE mytable SET other_column='foobar' WHERE main_column=value


Pavel

On Thu, Nov 18, 2010 at 7:41 PM, Nikolaus Rath <nikol...@rath.org> wrote:
> Hello,
>
> I understand that running INSERT or DELETE during an active SELECT query
> can get me into trouble. But is it safe to run (in pseudocode):
>
> for value in "SELECT main_column IN mytable":
>
>   UPDATE mytable SET other_column='foobar' WHERE main_column=value
>
> ?
>
>
> Thanks,
>
>   -Nikolaus
>
> --
>  »Time flies like an arrow, fruit flies like a Banana.«
>
>  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C
> _______________________________________________
> 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