Have resolved this. I only need a simple statement for adding the new column.
ALTER TABLE argusTable1 ADD COLUMN newField INTEGER Thanks, Andrew -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Andrew Stewart Sent: Friday, July 29, 2016 12:16 PM To: 'SQLite mailing list' <[email protected]> Subject: [sqlite] Drop Temporary table is returning Locked Hi, I am having issues when I need to translate a database that already exists (adding a field). I added the field using SQLiteStudio and it gives me the commands necessary to translate the database. When I employ these in my program, I get an error that I do not know how to work around. The sequence is this: ALTER TABLE argusTable1 RENAME TO argus_temp_table CREATE TABLE argusTable1 (tableID INTEGER PRIMARY KEY, newField INTEGER) INSERT INTO argusTable1 (tableID) SELECT (screenInstanceID) FROM argus_temp_table DROP TABLE argus_temp_table I run all 4 of these statements in separate sqlite3_exec statements. The first 3 run fine with no issue. When I try doing the 4th one I get a Table Locked error (6). If I loop to wait for it, it never returns. As the problem is with the temporary table, I wouldn't think any place else in my code would be causing this issue. I have tried running this SQLiteStudio, running each statement on its own, and there is no issue. Do not know what I am doing wrong. Following are my Pragmas used: PRAGMA synchronous = NORMAL PRAGMA journal_mode = MEMORY PRAGMA page_size = 2048 PRAGMA cache_size = 100000 PRAGMA temp_store = MEMORY SQLite version 3.9.2 is what I am using. Any assistance would be appreciated. Andrew Stewart Software Designer Argus Control Systems Ltd. Tel: (604) 536-9100 ext. 108 [email protected]<mailto:[email protected]> #101 - 18445 53rd Avenue | Surrey BC | CANADA | V3S 7A4 (604) 538-3531 | (800) 667-2090 | Fax (604) 538-4728 www.arguscontrols.com<http://www.arguscontrols.com/> Notice: This electronic transmission contains confidential information, intended only for the person(s) named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or any other use of this email is strictly prohibited. If you have received this transmission by error, please notify us immediately by return email and destroy the original transmission immediately and all copies thereof. _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

