Re[2]: [sqlite] How to get column description from table using SQL

2006-06-29 Thread blins
Привет Kurt, Wednesday, June 28, 2006, 6:19:37 PM, you wrote: KW blins [EMAIL PROTECTED] wrote: How to get column description from table using SQL KW pragma table_info() KW http://sqlite.org/pragma.html KW Regards Thanks for help, but I use sqlite through ODBC+ADO and this statement

RE: [sqlite] real time gui updates

2006-06-29 Thread Rob Menegon
Not sure whether I understand how this would occur. The application is not doing or responsible for the updates to the database. Its only function in life is to retrieve and display data. Updates, modifications occur via another application, so I was incorrect in my previous response to you -

RE: [sqlite] real time gui updates

2006-06-29 Thread C.Peachment
You could include a date/time field somewhere in the database that is queried on a regular basis by your display function. Depending on the update rate, you could poll every second, every minute, or every hour. Any change of value would justify a full data retrieval and screen refresh. The update

Re: [sqlite] real time gui updates

2006-06-29 Thread drh
Rob Menegon [EMAIL PROTECTED] wrote: Not sure whether I understand how this would occur. The application is not doing or responsible for the updates to the database. Its only function in life is to retrieve and display data. Updates, modifications occur via another application, so I was

RE: [sqlite] Preferred way to copy/flush new memory db to disk db ?

2006-06-29 Thread Denis Povshedny
Maybe you shall open in sqlite3_open a temporary file as a database file? And move it to destination in case of success WBR, Denis --- My requirements are database file must be removed from disk if any error while creating/copying tables, records or indices

Re: [sqlite] real time gui updates

2006-06-29 Thread Dennis Jenkins
[EMAIL PROTECTED] wrote: Rob Menegon [EMAIL PROTECTED] wrote: Not sure whether I understand how this would occur. The application is not doing or responsible for the updates to the database. Its only function in life is to retrieve and display data. Updates, modifications occur via

Re: [sqlite] real time gui updates

2006-06-29 Thread John Stanton
In that case you might use some form of inter-process communication like a named pipe or a semaphore which is activated by a change to the DB. The viewing process would have a thread waiting on the IPC channel or semaphore. When the DB changed it would automatically trigger a refresh in the

Re: [sqlite] use of index in ORDER BY clause

2006-06-29 Thread Jens Miltner
Am 27.06.2006 um 18:06 schrieb Dennis Cote: Jens Miltner wrote: I have a schema similar to this: CREATE TABLE foo (id integer primary key, name text); CREATE TABLE bar (id integer primary key, foo_id integer, something text); CREATE INDEX bar_idx on bar(foo_id, something); When I run a

Re: [sqlite] sqlite3_free_table question

2006-06-29 Thread Christian Smith
Dennis Cote uttered: Your call to sqlite3_free_table is correct. You free the error message by calling sqlite3_free(tresult.err_msg). If either pointer returned by sqlite3_get_table() is NULL, then no memory was allocated, so there is no need to free it, however I believe it should be safe

Re: [sqlite] use of index in ORDER BY clause

2006-06-29 Thread Jay Sprenkle
On 6/29/06, Jens Miltner [EMAIL PROTECTED] wrote: Is there any way to improve the ORDER BY performance for joined queries? From your answer that the intermediate results are sorted, I take it no index won't ever be used when using ORDER BY with a join query? You can use the explain command

Re: [sqlite] sqlite3_free_table question

2006-06-29 Thread Dennis Cote
Christian Smith wrote: sqlite3_free, and the sqlite3GenericFree that implements it asserts that the pointer passed in is not NULL. So it is not safe to pass in a NULL pointer. It should be safe, if sqlite3_free and co are mimicking the behaviour of the libc free. The current CVS

Re: [sqlite] sqlite too slow for me?

2006-06-29 Thread Cesar David Rodas Maldonado
I have a question for every body... SQLite was very slow for my inserts (like 5 inserts), with out sincronization but when i put BEGIN; before start with my inserts is was faster... like 1000 times more... :D why is that? On 6/28/06, Cesar David Rodas Maldonado [EMAIL PROTECTED] wrote:

Re: [sqlite] use of index in ORDER BY clause

2006-06-29 Thread Dennis Cote
Jens Miltner wrote: Is there any way to improve the ORDER BY performance for joined queries? From your answer that the intermediate results are sorted, I take it no index won't ever be used when using ORDER BY with a join query? Is there a way to rewrite the queries so we don't take the

RE: [sqlite] sqlite too slow for me?

2006-06-29 Thread Allan, Mark
I believe that when using a transaction, i.e. Begin, Commit. SQLite will only perform the actual writing to file when Commit is made, therefore less disk I/O, or all I/O done at the end rather than after each insert and therefore better performance. See documentation at:-

Re: [sqlite] sqlite3_free_table question

2006-06-29 Thread drh
Dennis Cote [EMAIL PROTECTED] wrote: Christian Smith wrote: sqlite3_free, and the sqlite3GenericFree that implements it asserts that the pointer passed in is not NULL. So it is not safe to pass in a NULL pointer. It should be safe, if sqlite3_free and co are mimicking the behaviour

Re: [sqlite] :memory: DB releasing storage

2006-06-29 Thread Rick Keiner
I'm back. ;) I found out that sqlite3pager_movepage goes in and calls unlinkHashChain which sets the page no to zero but leaves it on the pNextFree/pPrevFree list. On subsequent calls to memoryTruncate the page is never unlinked. But if the deletes are within a transaction sqlite3pager_movepage

Re: [sqlite] :memory: DB releasing storage

2006-06-29 Thread drh
Rick Keiner [EMAIL PROTECTED] wrote: I'm back. ;) I found out that sqlite3pager_movepage goes in and calls unlinkHashChain which sets the page no to zero but leaves it on the pNextFree/pPrevFree list. On subsequent calls to memoryTruncate the page is never unlinked. Please check and see if

Re: [sqlite] :memory: DB releasing storage

2006-06-29 Thread Rick Keiner
Great, that handled the memory leak but the auto-vacuum is still not working. Storage remains the same and is never released back to the system. When would this would it make it in a release? Thanks. Regards, Rick Keiner On 6/29/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Rick Keiner

[sqlite] sqlite3_free_table question

2006-06-29 Thread Richard Boyd
Hi again, I now check for NULL to be sure that I'm trying to free up a pointer that actually points to something. Is there an easy way for me to ensure that the memory has been successfully freed up? I understand this might be a basic C question rather than a specific Sqlite question, so

Re: [sqlite] sqlite3_free_table question

2006-06-29 Thread Jay Sprenkle
On 6/29/06, Richard Boyd [EMAIL PROTECTED] wrote: I now check for NULL to be sure that I'm trying to free up a pointer that actually points to something. Is there an easy way for me to ensure that the memory has been successfully freed up? I understand this might be a basic C question rather

RE: [sqlite] real time gui updates

2006-06-29 Thread Pat Wibbeler
Another alternative might be using an API that waits for events on the database file - for instance kqueues some unix variants or WaitForMultipleObjects and FindFirstChangeNotification/FindNextChangeNotification on windows. I agree that polling causes issues. It doesn't require much CPU if you

[sqlite] database corruption

2006-06-29 Thread Jens Miltner
Hi everybody, We have encountered two corrupted databases so far at customers and we have no idea how they could become corrupted (we haven't had any corruption in house so far). (Yes, I've read the How to corrupt your database files section, but I don't think any of the methods mentioned

Re: [sqlite] database corruption

2006-06-29 Thread drh
Jens Miltner [EMAIL PROTECTED] wrote: What's the best approach to try and rescue such a corrupt database? So far, I've sort of succeeded by using '.dump' to dump each single table (the global '.dump' would only dump 3 out of about 20 tables). Unfortunately, some of the data appears to be

RE: [sqlite] real time gui updates

2006-06-29 Thread Rob Menegon
Thanks for the feedback. This now gives me some direction. Rob Menegon MenMac Services Pty Ltd ABN: 54 088 928 321 Mobile: +61 416 271 348 Fax: +61 2 8569 2063 Phone: +61 2 9482 7193 Email: [EMAIL PROTECTED] Skype: rmenegon -Original Message- From: Dennis Jenkins