[sqlite] Create table while a dbdatareader is open

2015-12-07 Thread Lars Fiedler
Thanks.  Good to know about the "create table as" syntax, but I'm not selecting 
rows and just copying to another table.  For each row in one sqlite table, the 
system under development may do may do many things down stream - send emails, 
query other databases, and create tables and insert into the temporary sqlite 
database.

Right now I have a option to load all rows into memory to remove the lock so 
tables can be created downstream.

Lars


> On Dec 7, 2015, at 3:30 AM, Hick Gunter  wrote:
> 
> Maybe you are looking for the INSERT INTO ... SELECT or CREATE TABLE ... AS 
> SELECT syntax? This would be one write transaction instead of two separate, 
> incompatible transactions.
> 
> -Urspr?ngliche Nachricht-
> Von: sqlite-users-bounces at mailinglists.sqlite.org 
> [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Lars 
> Fiedler
> Gesendet: Sonntag, 06. Dezember 2015 21:47
> An: sqlite-users at mailinglists.sqlite.org
> Betreff: [sqlite] Create table while a dbdatareader is open
> 
> Is it possible with certain settings to have a dbdatareader iterating through 
> rows, and at the same time create a new table?  I've tried various settings - 
> read uncommitted, wal mode, shared cache.  But it looks like the open reader 
> has a read lock on sqlite_master (not read uncommitted), and the create table 
> command wants a write lock on sqlite_master.
> 
> Cheers,
>  Lars
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> 
> 
> ___
> Gunter Hick
> Software Engineer
> Scientific Games International GmbH
> FN 157284 a, HG Wien
> Klitschgasse 2-4, A-1130 Vienna, Austria
> Tel: +43 1 80100 0
> E-Mail: hick at scigames.at
> 
> This communication (including any attachments) is intended for the use of the 
> intended recipient(s) only and may contain information that is confidential, 
> privileged or legally protected. Any unauthorized use or dissemination of 
> this communication is strictly prohibited. If you have received this 
> communication in error, please immediately notify the sender by return e-mail 
> message and delete all copies of the original communication. Thank you for 
> your cooperation.
> 
> 
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Create table while a dbdatareader is open

2015-12-06 Thread Lars Fiedler
Is it possible with certain settings to have a dbdatareader iterating through 
rows, and at the same time create a new table?  I've tried various settings - 
read uncommitted, wal mode, shared cache.  But it looks like the open reader 
has a read lock on sqlite_master (not read uncommitted), and the create table 
command wants a write lock on sqlite_master.

Cheers, 
  Lars