[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] Sharing a database / Replication
From:       Simon <turner25 () gmail ! com>
Date:       2008-12-21 12:43:51
Message-ID: 494E3A07.3010806 () gmail ! com
[Download RAW message or body]

> Most you need to know about locking is found in:
> http://www.sqlite.org/lang_transaction.html
> 
> sqlite3_exec() these statements one by one:
> ATTACH 'filename' as db2;
> BEGIN IMMEDIATE; -- or EXCLUSIVE
> (error handling/retry) 
> 
> -- this assumes table1 has the exact 
> -- same definition in both db1 and db2
> INSERT INTO db1.table1 SELECT * FROM db2.table1;
> (error handling)
> 
> COMMIT; -- or ROLLBACK

Ok, good...  Thanks a lot for this quick structure!

Simon
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic