Why not use INSERT OR REPLACE to your advantage? If you set the maximum number of log entries you wanted to keep, then kept track of your log insert statement, you could wrap by
int this_log_entry_id=1; //initialize.. actually could be initialized by getting the log entry id of the min date in your log at the beginning of your program. .... if (this_log_entry_id > max_log_entries){ this_log_entry_id =1; } else{ this_log_entry_id } call_insert_function (this_log_entry_id /*becomes the primary key that you are inserting or replacing*/ , data_to_be_logged ,..... Adam On Tue, May 10, 2011 at 9:08 AM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 10 May 2011, at 1:57pm, Lauri Nurmi wrote: > > > El mar, 10-05-2011 a las 12:34 +0100, Simon Slavin escribió: > >> On 10 May 2011, at 11:42am, Lynton Grice wrote: > >> > >>> BTW: if I am using SQLIte as a logger, what PRAGMA statement can I use > >>> to say FIX the sqlite database size to say "5 MB"? > >> > >> There isn't one. SQLite would not know which records to delete. > > > > If such a pragma existed, SQLite wouldn't need to delete anything > > necessarily, it could behave like it behaves when trying to write to a > > full disk. > > Good idea. Or introduce a new result code for 'Database has reached > maximum allowed size'. Presumably it would be handled as fixing the number > of pages. Might be useful for small platforms like cellphones, where > running out of memory is a disaster. > > Simon. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- VerifEye Technologies Inc. 905-948-0015x245 151 Whitehall Dr, Unit 2 Markham ON, L3R 9T1 Canada _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users