Re: [sqlite] How to retrieve number of cached pages in memory?

2008-04-23 Thread Ralf Junker
See the Pager data structure and associated variables and functions in sqlite-3.5.x/src/pager.c. OK, it seems that the number I am interested in is stored as part of the Pager struct: int nPage; /* Total number of in-memory pages */ Now I just have to figure out how

Re: [sqlite] Trigger on an attached db.

2008-04-23 Thread Federico Granata
On Wed, Apr 23, 2008 at 12:22 AM, Igor Tandetnik [EMAIL PROTECTED] wrote: Each connection has its own independent temp database. You've created a temporary trigger which exists in the temp database for your connection. The trigger simply doesn't exist on the other connection. damn ... Yes,

Re: [sqlite] sqlite DB on a CD

2008-04-23 Thread Lauri Ojansivu
2008/4/22 [EMAIL PROTECTED]: Hi, I like to distribute my application on a CD. This application has a sqlite database which will be part of the distribution. I do not like anybody reading/accesing the database directly, so I put the database file inside a zip file which is password

Re: [sqlite] sqlite DB on a CD

2008-04-23 Thread Gregory Letellier
if your databse was not bigger you can put your sql dump in the zip and construct a memory database with this dump - Original Message - From: Lauri Ojansivu [EMAIL PROTECTED] To: General Discussion of SQLite Database sqlite-users@sqlite.org Sent: Wednesday, April 23, 2008 12:12 PM

Re: [sqlite] sqlite DB on a CD

2008-04-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lauri Ojansivu wrote: Another option is to buy Molebox that encrypts vb exe, sqlite database and other files to single packed exe where reading sqlite database from encrypted exe works like it was in same directory without any encryption, and

[sqlite] Blob truncation

2008-04-23 Thread vasil
Hello, I am trying to implement a simple file store based on the SQLite library. The idea is to use the SQLite as virtual folder. The logic is quite simple except the following detail: I need to read the files block by block (with 64k buffer size) and process each block with the zlib before

Re: [sqlite] Blob truncation

2008-04-23 Thread Robert Bielik
[EMAIL PROTECTED] skrev: Any help is very welcome and thank you in advice! The way I did it was to do a dummy write with a null device that just did: int write(const void * data, int dataLength) { blobLength += dataLength; } Then I used that length with sqlite3_bind_zeroblob and made

Re: [sqlite] Trigger on an attached db.

2008-04-23 Thread P Kishor
On 4/23/08, Federico Granata [EMAIL PROTECTED] wrote: On Wed, Apr 23, 2008 at 12:22 AM, Igor Tandetnik [EMAIL PROTECTED] wrote: Each connection has its own independent temp database. You've created a temporary trigger which exists in the temp database for your connection. The trigger

Re: [sqlite] How to execute the statment file using sqlite API

2008-04-23 Thread Fin Springs
On Apr 22, 2008, at 7:57 PM, Joanne Pham joannekpham-at-yahoo.com | sqlite| wrote: Hi all, I have the serveral sql statement in the one file call : getData.sql and I want to use the sqlite API to call this file to execute all sql statements in this file at once. Can you tell me what

Re: [sqlite] Blob truncation

2008-04-23 Thread Dennis Cote
[EMAIL PROTECTED] wrote: Is there a way to truncate a blob (for example set it size to the file size before compression and after inserting the compressed data to truncate the unused blob space)? Or it is possible to change the blob size on the fly? Any help is very welcome and thank you in

Re: [sqlite] Trigger on an attached db.

2008-04-23 Thread Federico Granata
Doing it in my app means polling the other db instead of receive an interrupt via trigger ... I can do it but it's the polling vs interrupt ... Obviously I prefer to sit and wait for data instead of looping looking for data but if it's the only way ... -- [image: Just A Little Bit Of

Re: [sqlite] How to execute the statment file using sqlite API

2008-04-23 Thread Joanne Pham
Thanks for the info. So I don't want to read the file into array and executes it. I have the define the array of characters as below: .output outputFile.mode csv select startTime, appName, appType, isAppDeleted, remoteWXId; but it didn't work. Can you please help. Thanks, JP - Original

[sqlite] sqlite3_exec return an error message

2008-04-23 Thread Joanne Pham
Hi All, I have the following codes to execute the sql file but the error message return back that dot(.). It seems like sqlite3_exec didn't like .output wanPerfTableTest. So how go to get arround with this command .output wanPerfTableTest Your help is greatly appreciated. Thanks JP

Re: [sqlite] sqlite3_exec return an error message

2008-04-23 Thread Igor Tandetnik
Joanne Pham [EMAIL PROTECTED] wrote: I have the following codes to execute the sql file but the error message return back that dot(.). It seems like sqlite3_exec didn't like .output wanPerfTableTest. So how go to get arround with this command .output wanPerfTableTest strcpy(stmt[0],.read

Re: [sqlite] sqlite3_exec return an error message

2008-04-23 Thread Joanne Pham
Thanks a lot Igor! But the codes below didn't work too: char stmt[STMT_LEN]; char *sqlStmt = stmt[0]; strcpy(stmt[0],output compressTable; mode csv; select * from compressTable; ); sqlSt= sqlite3_exec(pDb,sqlStmt , NULL, 0, errMsg); if (sqlSt != SQLITE_OK ) {

Re: [sqlite] sqlite3_exec return an error message

2008-04-23 Thread Igor Tandetnik
Joanne Pham [EMAIL PROTECTED] wrote: Thanks a lot Igor! But the codes below didn't work too: char stmt[STMT_LEN]; char *sqlStmt = stmt[0]; strcpy(stmt[0],output compressTable; mode csv; select * from compressTable; ); I didn't say the dot in front is wrong: the whole command is wrong.

Re: [sqlite] sqlite3_exec return an error message

2008-04-23 Thread P Kishor
On 4/23/08, Joanne Pham [EMAIL PROTECTED] wrote: Thanks a lot Igor! But the codes below didn't work too: char stmt[STMT_LEN]; char *sqlStmt = stmt[0]; strcpy(stmt[0],output compressTable; mode csv; select * from compressTable; ); sqlSt= sqlite3_exec(pDb,sqlStmt , NULL, 0,

Re: [sqlite] sqlite3_exec return an error message

2008-04-23 Thread Joanne Pham
Thanks to both of you! Sorry I am new baby to sqlite3. Now I got it. So I should use the shell script to execute these commands. Thanks, Joanne - Original Message From: P Kishor [EMAIL PROTECTED] To: General Discussion of SQLite Database sqlite-users@sqlite.org Sent: Wednesday, April

Re: [sqlite] sqlite3_exec return an error message

2008-04-23 Thread Joanne Pham
Hi Igor, Previous email you mentioned : SQLite won't read the file for you, you will have to do it yourself (and probably strip all dot commands from it before passign the contents to sqlite3_exec). Alternatively, just shell out to sqlite3 utility with an appropriate command line.