Re: [sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-14 Thread Igor Tandetnik
On 3/14/2012 10:13 AM, FengTao DING wrote: UPDATE game LEFT JOIN updatemag.game AS idcgame ON idcgame.id=game.id SET game.name=idcgame.name,game.launcher=idcgame.laucher,game.icon=game.directory+idcgame.launcher, game.info_version=idcgame.information_version,game.modify_version=game.modify_versio

Re: [sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-14 Thread Kit
2012/3/14, FengTao DING : > Because in my UPDATE case, the new values that will be updated come from > another different table, and the UPDATE's WHERE condition also involves > columns from more than one tables(actually 3), UPDATE tab1 SET val1=(SELECT val2 FROM tab2 WHERE ...) WHERE val3 in (S

Re: [sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-14 Thread Marc L. Allen
n of SQLite Database > Subject: Re: [sqlite] Is there any option that can enable me to do > INSERT or UPDATE while SELECT > > Thanks, Igor, Nico, and anyone pay attention to this post. > Here are the schemas: > > In Server.db3 > --- > Table [game] >

Re: [sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-14 Thread FengTao DING
Thanks, Igor, Nico, and anyone pay attention to this post. Here are the schemas: In Server.db3 --- Table [game] Fields: 37 [id]: TEXT [name]: TEXT [category2_id]: INTEGER [icon]: TEXT [hot_level]: TEXT [no_update]: INTEGER

Re: [sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-14 Thread Igor Tandetnik
FengTao DING wrote: > I prefer to one connection rather than WAL if it can accomplish the job. > > But I found that, INSERT can be done in one connection, but UPDATE can not. > > Because in my UPDATE case, the new values that will be updated come from > another different table, and the UPDATE's

Re: [sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-14 Thread FengTao DING
I prefer to one connection rather than WAL if it can accomplish the job. But I found that, INSERT can be done in one connection, but UPDATE can not. Because in my UPDATE case, the new values that will be updated come from another different table, and the UPDATE's WHERE condition also involves col

Re: [sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-13 Thread Igor Tandetnik
On 3/13/2012 10:38 PM, FengTao DING wrote: Hi all, I wrote a piece of code, that open two sqlite3 connections, use connection1 to do a SELECT query, while stepping in this query, when some condition matches, it uses connection2 to do a INSERT query; when another condition matches, it uses conne

Re: [sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-13 Thread Nico Williams
Use one connection. Attach the other DBs to this one connection, then use INSERT OR REPLACE INTO table SELECT ...;. See the recent thread about INSERT OR REPLACE. Nico -- ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-

[sqlite] Is there any option that can enable me to do INSERT or UPDATE while SELECT

2012-03-13 Thread FengTao DING
Hi all, I wrote a piece of code, that open two sqlite3 connections, use connection1 to do a SELECT query, while stepping in this query, when some condition matches, it uses connection2 to do a INSERT query; when another condition matches, it uses connection2 to do a UPDATE query. As common resul