On 21/10/10 00:35, Igor Tandetnik wrote:
> Alan Chandler<a...@chandlerfamily.org.uk>  wrote:
>> Further to my other post related to attaching to databases with PHP PDO,
>>   I have now managed to ATTACH OK
>>
>> However, when I come to DETACH, I am getting a Database is locked error
>> when I try and execute it.
>>
>> The only thing happening to that database in between ATTACH and DETACH
>> is a single row SELECT
>
> Make sure you reset or finalize the statement (not sure how it's done in PHP).
I believe closeCursor();  does the job.  If not, I unset the variable.

However, I have figured out the problem - which is really sad since I 
can't do what I hoped - which is loop round a set of rows from a higher 
level select statement ATTACHing and DETACHing to a database in turn . 
Because the top level select loop is its own transaction, you can't 
detach from the database which you attached in the inner part of the 
loop since at that moment you are in a transaction.

I think my way out of the problem is to pull out all the rows into a 
single array, then close the transaction and interate over the array 
members.  Fortunately in the case its just a menu - so there probably 
won't be too many items.



-- 
Alan Chandler
http://www.chandlerfamily.org.uk
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to