[sqlite] Database disk image is malformed
Hi, I have an application running on Windows CE4.1 PDAs with SD cards. Sometimes I have errors executing commands on database that are: 11-database disk image is malformed This happens for example on table MSTBP executing "Delete From MSTBP". Or inserting into it. The strange thing is, that after I restart my application (hence the connection) the error disappears. Everything continues working normally and the previous SQL statements, that before generated this error, start working normally. Any ideas how I can prevent this from happening? I looked into pragma and specifically into: PRAGMA journal_mode = /PERSIST /Do you thing this may help? Do you think that maybe this problem is because at a given time, the sqlite engine could not "access" the journal file? Some strange hardware or OS problem that did not created/deleted the file immediately, mainly because it is on a SD Card? Thanks -- Cumprimentos / Best Regards Filipe Madureira - SYSDEV, LDA - Mobile Solutions (www.sysdevsolutions.com) Tel: +351 234098066 Fax: +351 234188400 - ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Attached database
Hi, Is there a way to get a list of attached databases? Either by SQL or by function call? I want to attach several databases, at several points in time. It can happen that I attempt to attach the same database several times, but I want to prevent different attaches to the same database if it is already attached. I can create an internal structure of my own to manage this, but if it is already available in SQLite it is easier. Thanks Cumprimentos / Best Regards Filipe Madureira - SYSDEV, LDA - Mobile Solutions (www.sysdevsolutions.com) Tel: +351 234188027 Fax: +351 234188400 - ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] sqlite3_blob_read declaration
Hi, I have an error for sometime compiling the latest versions of SQLite amalgamation on eVC++ 4 error: "'Z' : use of class template requires template argument list" The problem is in the declaration of "sqlite3_blob_read prototype". It is declared in "sqlite3.h" and "sqlite3.c" as: SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); and it is implemented in "sqlite3.c" as: SQLITE_API int sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){ return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData); } If I change the uppercase "void *Z" in the declarations to lowerase "void *z" the compilation error disappears. Is this supposed to be declared like this? The other functions declarations (for example "sqlite3_blob_write") are all in lowercase. Thanks Cumprimentos / Best Regards Filipe Madureira - SYSDEV, LDA - Mobile Solutions (www.sysdevsolutions.com) Tel: +351 234188027 Fax: +351 234188400 - ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Windows CE performance
Hi, I use Windows CE. I was using a version of SQLite 3.2.2 I got from sourceforge.net I decided to download the latest 3.5.9, I compiled and everything seems to work OK on Windows CE. But I noticed a very big performance decrease. In my application I had a process that took about 30 seconds. Then, I just recompiled with version 3.5.9 an the exact same thing takes about 1 minute. My question is, do I need to modify something for WindowsCE to increase performance? Note: On the Win32, the performance improvement is impressive, but I need Windows CE Thanks -- Cumprimentos / Best Regards Filipe Madureira - SYSDEV, LDA - Mobile Solutions (www.sysdevsolutions.com) Tel: +351 234188027 Fax: +351 234188400 - -- Cumprimentos / Best Regards Filipe Madureira - SYSDEV, LDA - Mobile Solutions (www.sysdevsolutions.com) Tel: +351 234188027 Fax: +351 234188400 - ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Windows CE performance
Hi, What PRAGMA settings should I check? The locking_mode? Yes, the problem is with INSERT. I am running about 3500 Inserts inside a transaction (BEGGIN TRANSACTION -> COMMIT TRANSACTION) Cumprimentos / Best Regards Filipe Madureira - SYSDEV, LDA - Mobile Solutions (www.sysdevsolutions.com) Tel: +351 234188027 Fax: +351 234188400 - [EMAIL PROTECTED] wrote: > Hello Filipe > > Have you already checked your PRAGMA settings four your embedded version? > (see http://www.sqlite.org/pragma.html) > > On which operation do you have you performance decrease? Is it INSERT > performance? > > Daniel > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Windows CE performance
Hi, Thanks for your help. Just one question, you asked me in your previous e-mail if it where INSERT operations. Do you think it may be related to this? Do you know of some issue about INSERTs that can slow performance in the recent versions? Because the other operations seem better. Only the INSERT seems to have performance problems. Cumprimentos / Best Regards Filipe Madureira - SYSDEV, LDA - Mobile Solutions (www.sysdevsolutions.com) Tel: +351 234188027 Fax: +351 234188400 - [EMAIL PROTECTED] wrote: > Hello > > As usual, there is no general rule. You have to define the best settings for > your embedded environement yourself. > > Start here: > "[sqlite] Performance tuning using PRAGMA, other methods" > http://www.mail-archive.com/sqlite-users@sqlite.org/msg29343.html > > Try different settings to get the feeling which PRAGMAs are critical for you. > > Daniel > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How can I load big file into a sqlite database?
Hi, I am interested in this issue also. I didn't understand the first part of your answer. "sqlite3 databasefile < infile" ?? The ".import FILE TABLE" works, but it is from CLI. How can I do it in my C++ application using the sqlite3? Thanks Filipe Madureira Alexandre Courbot wrote: >> I usually used "load data infile" command in mysql to insert long list of >> data. >> But I could not find this kind of command in sqlite. >> How do you load big file into a sqlite database?? >> > > I guess what you want to do is "sqlite3 databasefile < infile" > > See also the ".import FILE TABLE" command to inport a file into a single > table. > > Alex. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How can I load big file into a sqlite database?
That's what I do. I was looking for a kind of pre-built solution that could have better performance in loading a table than to do a INSERT for each line inside a transaction. But thanks Filipe Madureira Alexandre Courbot wrote: >> I am interested in this issue also. >> I didn't understand the first part of your answer. "sqlite3 databasefile >> < infile" ?? >> >> The ".import FILE TABLE" works, but it is from CLI. How can I do it in >> my C++ application using the sqlite3? >> > > An equivalent would be to read the file line by line and execute the > statements it contains. > > Alex. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Database lost
Hi, I have an application running on a Windows Mobile 6 PDA with SQLite database. In a synchronization process I got the following logs from my application: SQL: Insert Or Replace Into MSCLI (CLICOD,CLINOM,CLIMOR,CLILOC,CLICPT,CLINCT,CLITPC,CLIPLA,CLIRES,CLIPRC,CLITEL,CLITLM,CLIFAX,CLIZON,CLICVD,CLIEML,CLIOBS,CLITDC,CLIDPP,CLINM2,CLIMO2,CLICT1,CLINIB,CLIREQ,CLIDTV,CLIDDV,CLILCE,CLIGP1,CLIGP2,CLIGP3,CLISU1,CLISU2,CLISU3,CLIIDA,CLIOBD,CLISU4,CLISU5,CLISU6,CLISU7,CLISU8,CLISU9,CLIPCA,CLIPCF,CLIPCC,CLIPBN,CLIUNA,CLITIP,CLICLA,CLICT2,CLICT3,CLICT4,CLICT5,CLICT6,CLICT7,CLICT8,CLICT9,CLIIVA,CLIST1,CLIST3) Values('211010392','BARCAROLA(ARRABIDA SHOPPING)','CAFE SNACK BAR,LDA.','ARRABIDA SHOPPING,LJ.218','4400 VILA NOVA DE GAIA','123456','',0,0,1,'4354543','354543','','','','','',0,0,'','','',' .. . ','','',0,'','','','','?','GERAL','','','','','','','','','',0,0,0,0,0,'','','','','','','','','','','','N','S') ERROR: database or disk is full SQL: Insert Or Replace Into MSCLI (CLICOD,CLINOM,CLIMOR,CLILOC,CLICPT,CLINCT,CLITPC,CLIPLA,CLIRES,CLIPRC,CLITEL,CLITLM,CLIFAX,CLIZON,CLICVD,CLIEML,CLIOBS,CLITDC,CLIDPP,CLINM2,CLIMO2,CLICT1,CLINIB,CLIREQ,CLIDTV,CLIDDV,CLILCE,CLIGP1,CLIGP2,CLIGP3,CLISU1,CLISU2,CLISU3,CLIIDA,CLIOBD,CLISU4,CLISU5,CLISU6,CLISU7,CLISU8,CLISU9,CLIPCA,CLIPCF,CLIPCC,CLIPBN,CLIUNA,CLITIP,CLICLA,CLICT2,CLICT3,CLICT4,CLICT5,CLICT6,CLICT7,CLICT8,CLICT9,CLIIVA,CLIST1,CLIST3) Values('211010457','BARCAROLA(DOLCE VITA)','CUNHADOS & MANOS, LDA','C.C.DOLCE VITA,LOJA 312 RUA CAMPEOES','EUROPEUS 4000 PORTO','234567','',0,0,1,'345435435','3454355445','','','','','',0,0,'','','',' .. . ','','',0,'','','','','D.RAQUEL','GERAL','','','','','','','','','',0,0,0,0,0,'','','','','','','','','','','','N','S') ERROR: unable to open database file SQL: Insert Or Replace Into MSCLI (CLICOD,CLINOM,CLIMOR,CLILOC,CLICPT,CLINCT,CLITPC,CLIPLA,CLIRES,CLIPRC,CLITEL,CLITLM,CLIFAX,CLIZON,CLICVD,CLIEML,CLIOBS,CLITDC,CLIDPP,CLINM2,CLIMO2,CLICT1,CLINIB,CLIREQ,CLIDTV,CLIDDV,CLILCE,CLIGP1,CLIGP2,CLIGP3,CLISU1,CLISU2,CLISU3,CLIIDA,CLIOBD,CLISU4,CLISU5,CLISU6,CLISU7,CLISU8,CLISU9,CLIPCA,CLIPCF,CLIPCC,CLIPBN,CLIUNA,CLITIP,CLICLA,CLICT2,CLICT3,CLICT4,CLICT5,CLICT6,CLICT7,CLICT8,CLICT9,CLIIVA,CLIST1,CLIST3) Values('211010406','ROCA DOCE CONFEITARIA+++','ROCA DOCE CONFEITARIA, LDA++','RUA EMIDIO PINTO, 19 - STA.MARINHA++','4400-670 V.N.GAIA+++','345678+++','',0,0,1,'2542345345','3454354343','','','','','',0,0,'+++CHEQUE DEVOLVIDO+','','','.. . ','','',0,'','','','','SR.MANUEL VIEIRA','SUL4F','','','','','','','','','',0,0,0,0,0,'','','','','','','','','','','','N','S') ERROR: unable to open database file etc, etc, etc, Then after the application restarted I got the same errors: SQL: Insert Or Replace Into MSCLI (CLICOD,CLINOM,CLIMOR,CLILOC,CLICPT,CLINCT,CLITPC,CLIPLA,CLIRES,CLIPRC,CLITEL,CLITLM,CLIFAX,CLIZON,CLICVD,CLIEML,CLIOBS,CLITDC,CLIDPP,CLINM2,CLIMO2,CLICT1,CLINIB,CLIREQ,CLIDTV,CLIDDV,CLILCE,CLIGP1,CLIGP2,CLIGP3,CLISU1,CLISU2,CLISU3,CLIIDA,CLIOBD,CLISU4,CLISU5,CLISU6,CLISU7,CLISU8,CLISU9,CLIPCA,CLIPCF,CLIPCC,CLIPBN,CLIUNA,CLITIP,CLICLA,CLICT2,CLICT3,CLICT4,CLICT5,CLICT6,CLICT7,CLICT8,CLICT9,CLIIVA,CLIST1,CLIST3) Values('211015498','REST.DORNA VELHA','REST.DORNA VELHA, LDA+++','RUA DAS OLIVEIRAS, NÂș340','4405-889 V.N.GAIA+++','55443323222+++','',0,0,1,'5435354534','234543534','','','','','',0,0,'','','',' .. . ','','',0,'','','','','SR.VIEIRA','SUL5F','','','','','','','','','',0,0,0,0,0,'','','','','','','','','','','','N','S') ERROR: database or disk is full etc, etc, etc, After another application restart I lost the database. The database file got with 0 Bytes and no Journal file. SQLite version is 3.6.4 and I am running things inside a transaction. Anyone has any idea how can this happen that we loose the entire Data Base. Or how can I prevent something like this from happening? Is it to be expected that on a Disk Full situation we can loose everything? Maybe on the rollback? -- Cumprimentos / Best Regards Filipe Madureira - SYSDEV, LDA - Mobile Solutions (www.sysdevsolutions.com) Tel: +351 234188027 Fax: +351 234188400 - ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] float to string conversion problem
Hi, I have a problem executing a query on a WinCE6 ARM device. I use SQlite for years and tested on all types of devices including WinCE6 ARM and never had a problem. But I have one problem on particular device that has a Texas Instruments ARM CPU with WinCE6. A very simple way to reproduce my problem is: Create Table t1(c1 DECIMAL(12,3)) Insert Into t1(c1) values(2.55) Select c1 From t1 I run this "Select" with sqlite3_get_table() The value I get is "3.,+" It makes no sense, it is not even a number, and only happens if the decimal values have a number higher than 5. This seems to be a problem with this CPU/WinCE version. I don't know SQLite source code, and it is huge, so can someone tell me where in the source code the float (or double, I don't know) value of 2.55 is being converted to a string to be outputed by sqlite3_get_table()? Or any hint on how to track the problem? Note: I copied the database file to my PC and the value stored there is 2.55, so the problem is retrieving the value on the device. -- Cumprimentos / Best Regards Filipe Madureira - SYSDEV, LDA - Mobile Solutions (www.sysdevsolutions.com) Tel: +351 234188027 Fax: +351 234188400 - ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] float to string conversion problem
Hi, Thanks for the great help. I tracked the problem to et_getdigit() More precisely to: digit = (int)*val; So, SQLite is assuming that "double" to "int" cast will truncate the value. This should be true. But in this device this is not happening, so if "val" is 2.55 I get 3 in "digit". Anyone knows why this could happen? I found something that makes it work correctly. If I call (Visual Studio C++): _controlfp(_RC_CHOP , _MCW_RC); it works correctly. But I am a little bit out of my league here. Wont this possibly cause other problems somewhere else? Isn't the default setting with _RC_NEAR? (Note: This call is thread dependent) Cumprimentos / Best Regards Filipe Madureira - SYSDEV, LDA - Mobile Solutions (www.sysdevsolutions.com) Tel: +351 234188027 Fax: +351 234188400 - >Floating point to ASCII conversion happens here: > > http://www.sqlite.org/src/artifact/bff529ed476?ln=406-553 > > > >-- >D. Richard Hipp >drh at sqlite.org ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users