I still can't get this to work.
Can someone please help.
:working:
I don't understand how to do this.
Many thanks in advance.



Pejayuk wrote:
> 
> That is fantastic Igor.
> Thankyou.
> All I need to do now is work out how to get an update query to use a
> select query to update the records from stats_memory to stats_static after
> doing the link.
> I think google may be able to help me with that.
> Thankyou for your time.
> =)
> 
> EDIT:
> I have just had a look around google. I think the following is what I need
> to do but would like to know if someone can confirm I have this correct.
> 
> I have the static_stats database and :memory: database open.
> I then attach as follows.
> 
> ATTACH ':memory:' as db1;
> ATTACH 'stats_static' as db2;
> 
> I then update the records in stats_static stats as follows from the
> :memory: stats table.
> INSERT OR REPLACE INTO db2.stats (rank, steamid, playername, zkills,
> hkills, deaths, degrade, prounds, lastvisit, points) SELECT rank, steamid,
> playername, zkills, hkills, deaths, degrade, prounds, lastvisit, points
> from db1.stats
> 
> I then detach the databases as follows.
> DETACH 'stats_static'
> DETACH ':memory:' 
> 
> a) Would the insert or replace query as shown above, update the
> stats_static database with the fields from :memory: ?.
> b) After the detach command, would both the databases still be open as
> they were before the attach command?.
> 
> Many thanks in advance.
> 
> EDIT2:
> Another thought.
> If I executed the following querys on the stats_static database.
> 
> ATTACH ':memory:' as db1;
> 
> INSERT OR REPLACE INTO stats SELECT rank, steamid, playername, zkills,
> hkills, deaths, degrade, prounds, lastvisit, points from db1.stats
> 
> DETACH ':memory:'
> 
> Does that give me what I want.
> Think this is more what I should be doing.
> Can someone please confirm.
> 
> Sorry for all the edits.
> 
> Many thanks.
> 
> 
> 
> Igor Tandetnik wrote:
>> 
>> "Pejayuk" <[EMAIL PROTECTED]> wrote in
>> message news:[EMAIL PROTECTED]
>>> Is it possible to have a single SQL query execute on the stats_static
>>> stats database and have it update from the records in stats_memory
>>> stats database?.
>> 
>> http://www.sqlite.org/lang_attach.html
>> 
>> Igor Tandetnik
>> 
>> 
>> 
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Update-static-database-with-records-from-memory-database.-tp18187288p18246157.html
Sent from the SQLite mailing list archive at Nabble.com.

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

Reply via email to