Hello,

I am using prepared stmts to cache selected record for later use. I have a 
wrapper class, that has methods like AsString(name), AsFloat(name) etc to 
extract data for a column name. 

I prepare, bind and then do Sqlite3_step() to get record. Later I use 
sqlite3_column_XXX() to access data. 

My concern is - do open selective prepared stmts depend on something in db or 
lock something in db? 


Var Alice := Db.SelectRecord('SELECT * FROM client WHERE client_name = ?', [  
'alice' ]);

1. If I drop record for "alice" from db and then access column data in prepared 
stmt will it work OK?

2. Can I drop client table while having such prepared stmt not closed? Will I 
be able to access data even if table was dropped?

3. If I have a lot of such stmts (100 or more) will it somehow affect 
performance of SQLite or waste lots of memory? Are there some kind of cursors 
for each selecting prepared stmt? 

4. If there is a cursor, maybe there is a way to disconnect a cursor from stmt 
keeping the single record still available? Its always about a single record. Is 
there anything to ease the burden of stopped selective stmt but not closing it?

5. Other disadvantages I might have missed?


A countrary to this is getting all the data from record to some user class and 
closing stmt. i dont like overhead of it. 
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to