Re: [sqlite] SQLite fow winrt metro application
On 13.05.2012 15:16 Simon Slavin said the following: On 13 May 2012, at 12:33pm, Michael Steiger<msli...@infoworks.at> wrote: On 13.05.2012 13:24 Simon Slavin said the following: On 13 May 2012, at 12:19pm, Ofer Ebert<ofer.eb...@bioness.co.il> wrote: I need to handle an sql database in my metro application (Windows 8) can I do it and how I use it from a c# application. Download the SQLite C amalgamation library from Quick response as always but not relevant for C# Please explain why so I can provide accurate information in future. A good JavaScript interface is SQLite3-WinRT. The OP specified C#. How would one do it from C# under WinRT ? I meant that the answer to compile C sourcecode for a C# question is not really relevant. No matter if it is for Metro or not. But Richard and Pavel have provided enough details to answer the original question. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQLite fow winrt metro application
On 13.05.2012 13:24 Simon Slavin said the following: On 13 May 2012, at 12:19pm, Ofer Ebertwrote: I need to handle an sql database in my metro application (Windows 8) can I do it and how I use it from a c# application. Download the SQLite C amalgamation library from Quick response as always but not relevant for C# Regards Michael ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Downgrade support for OS/2?
On 03.04.2012 19:38 Richard Hipp said the following: We propose to remove the VFS module for OS/2 from the SQLite amalgamation in the next release, reducing the size of the amalgamation source file by 1924 lines (or about 1.4%). If this change will cause you any serious hardship, please speak up and we will reconsider. And this one day after the 25th anniversary of the announcement of OS/2. RIP OS/2 and RIP OS/2 support in sqlite. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Is there any API for counting number of rows in a particular table.
On 05.02.2012 19:18 Fabio Spadaro said the following: 2012/1/31 John ElrickOn Tue, Jan 31, 2012 at 6:01 AM, Fabio Spadaro How do you make it open database files that have an extension other than .slt? RBS Tonight I will see to create a new version with bug fixes. Meanwhile you could give me some feedback such as opening a file with any extension by entering *.* in the filename of the FileDialog. Common extensions I've seen used for SQLite: .sqlite .db .db3 I am pleased to announce the new version Sqlite Root 1.9.7.4 at www.sqliteroot.com that opens the database with the extension: sqlite db db3 Any feedbak is welcome! Another feedback (but this gets more and more offtopic here): First try, first error message and program does not even start: The logfile 'C:\Program Files (x86)\Sqlite Root 1.9.7.4\SqliteRoot.exe.log' could not be opened: [Errno 13] Permission denied: 'C:\\Program Files (x86)\\Sqlite Root 1.9.7.4\\SqliteRoot.exe.log' No surprise since writing to "C:\Program Files" requires higher permission than the default user has. You should store the logfile to some user directory. Michael ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Is there any API for counting number of rows in a particular table.
On 05.02.2012 19:18 Fabio Spadaro said the following: 2012/1/31 John ElrickOn Tue, Jan 31, 2012 at 6:01 AM, Fabio Spadaro How do you make it open database files that have an extension other than .slt? RBS Tonight I will see to create a new version with bug fixes. Meanwhile you could give me some feedback such as opening a file with any extension by entering *.* in the filename of the FileDialog. Common extensions I've seen used for SQLite: .sqlite .db .db3 I am pleased to announce the new version Sqlite Root 1.9.7.4 at www.sqliteroot.com that opens the database with the extension: sqlite db db3 Any feedbak is welcome! IMHO any program which uses sqlite3 databasefiles should not assume any extension at all. BTW, Norton Antivirus removes SqliteRoot-1.9.7.4-win32.exe Details can be found here: http://securityresponse.symantec.com/security_response/writeup.jsp?docid=2010-051308-1854-99=4294919973 Regards, Michael ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How to drop a table using sqlite API
Hi Friend, could you please start to read the online documentation at http://www.sqlite.org/docs.html Almost every question you ask is already answered there. Thanks Michael On 02.02.2012 12:26 bhaskarReddy said the following: HI Friends, How can i drop a table using sqlite API. Regards, Bhaskar. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Problem with sqlite3_prepare_v2?
On 17.05.2011 11:22 StyveA said the following: > > Hello everyone, > > I don't understand why when I use the sqlite3_prepare_v2() function, some > bind_xxx, and then commit, the data stored in my database are redundant.. > > To be more precise, when I run my code (see below), I obtain this in my > database : > > 1|s||| > 2|s|t|| > 3|s|t|y| > 4|s|t|y|ve > > > Part of the code === > >sprintf(insert_data,"INSERT INTO %s(pid, class_id, instance_id, dataset) > VALUES(?,?,?,?)", table_name); >const char *zSql = insert_data; > > >sqlite3_exec(db, "BEGIN", NULL, NULL, NULL); >if( sqlite3_prepare_v2(db, zSql, strlen(zSql)+1,, pzTail) != > SQLITE_OK ) >{ > sqlite3_close(db); > exit(1); >} > > if(ppStmt) >{ > >sqlite3_bind_blob(ppStmt, 1,_value, sizeof(pid_value), > SQLITE_TRANSIENT); >sqlite3_step(ppStmt); >sqlite3_reset(ppStmt); remove these >sqlite3_bind_blob(ppStmt, 2,_id_value, sizeof(class_id_value), > SQLITE_TRANSIENT); >sqlite3_step(ppStmt); >sqlite3_reset(ppStmt); remove these >sqlite3_bind_blob(ppStmt, 3,_id_value, > sizeof(instance_id_value), SQLITE_TRANSIENT); >sqlite3_step(ppStmt); >sqlite3_reset(ppStmt); remove these >sqlite3_bind_blob(ppStmt, 4,_struct, sizeof(dataset_struct), > SQLITE_TRANSIENT); >sqlite3_step(ppStmt); >sqlite3_finalize(ppStmt); >sqlite3_exec(db, "COMMIT", NULL, NULL, NULL); >} > > > > > Is there an error in the code? Or is it impossible to submit all data in one > time without specifying the PRIMARY_ID? You need to prepare bind all variables (not just one) step ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] using sqlite3_get_table --additional info...
On 31.03.2011 16:30 john darnell said the following: > BTW, if there is a better way to get a row count without using > sqlite3_get_table() that would also work. This will work withput fetching the table dbrc = sqlite3_prepare_v2 (db, "select count(*) from table", -1, , NULL); if (dbrc != SQLITE_OK) { //error } if (sqlite3_step(stmt) == SQLITE_ROW) { count = sqlite3_column_int (stmt, 0); } else { count = 0; } ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Strange "database disk image is malformed" problems
Hi Pavel! On 20.12.2010 15:36 Pavel Ivanov said the following: >>>> Can you tell us what is producing that log text you found ? >>> I am developing network appliances using EZchip network processors and >>> for implementing some backend code I recently switched to SQLite. >> >> Mmm. Well, it could be overwriting some of your memory, or overwriting the >> filespace. My bet is memory. Or it's possible you've found a bug in SQLite >> where it writes the wrong memory to the file, I suppose. Perhaps lint, >> clang, or something like them would spot the problem. Good luck. > > There's also another possibility that library writing logs do that > unconditionally to stdout/stderr, i.e. to file handles 1 or 2. But if > you for some reason close those handles next call to sqlite3_open will > use them for database file. So in this case library will write > straight into your database without knowing about that. You are great! This is really possible in this case. The application runs as a daemon and closes all file handles at startup. Now I need to check what this library is doing Many thanks Michael > On Mon, Dec 20, 2010 at 7:58 AM, Simon Slavin<slav...@bigfraud.org> wrote: >> >> On 20 Dec 2010, at 12:49pm, Michael Steiger wrote: >> >>>> Can you tell us what is producing that log text you found ? >>> I am developing network appliances using EZchip network processors and >>> for implementing some backend code I recently switched to SQLite. >> >> Mmm. Well, it could be overwriting some of your memory, or overwriting the >> filespace. My bet is memory. Or it's possible you've found a bug in SQLite >> where it writes the wrong memory to the file, I suppose. Perhaps lint, >> clang, or something like them would spot the problem. Good luck. >> >> Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Strange "database disk image is malformed" problems
On 20.12.2010 13:32 Simon Slavin said the following: > > On 20 Dec 2010, at 12:17pm, Michael Steiger wrote: > >> In the meantime I further analyzed the problem and I also looked at the >> corrupt databasefile. To my surprise it contained some logfile output >> from another library I am using. It seems that if I turn on logging for >> this library some log output is written to the database file. But I have >> absolutely no idea how this mixup can happen. > > Since SQLite does not do any logging, it would seem that the problem is not > entirely within the SQLite library. Since you appear to be using plain C > function calls to access SQLite this suggests that there is some sort of > problem with your memory handling. I am sure that the problem is not entirely within SQLite. Yes, I am using plain C and it must be some memory error. Just need to find it ;-) > Is there a chance that you are using either the file handle or the > database handle for something other than SQLite3 calls ? And I have already scanned my code if there is a mixup of the database handle and some other code. But I found none. "Using the file handle"? I only open the database using sqlite3_open and then use the database handle returned. No direct file access to the SQLite databasefile. > Can you tell us what is producing that log text you found ? I am developing network appliances using EZchip network processors and for implementing some backend code I recently switched to SQLite. The code which produces the log text is not called from my code but is used deep inside this library (I have the source code to look at). Thanks Michael ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Strange "database disk image is malformed" problems
Hi Simon, On 20:59 Simon Slavin said the following: > > On 19 Dec 2010, at 2:56pm, Michael Steiger wrote: > >> sqlite3_prepare_v2, sqlite3_step, sqlite_column_*, ...: to read data > > erm ... sqlite3_finalize() ? Is already there (just forgot to mention it) > http://www.sqlite.org/c3ref/stmt.html > >> If I try to reproduce this sequence using sqlite3 the problem does not >> occur (qed). > > Sorry, I thought sqlite3 was what got you the problem. Nope. Using sqlite3 either it works or it shows the error. In the meantime I further analyzed the problem and I also looked at the corrupt databasefile. To my surprise it contained some logfile output from another library I am using. It seems that if I turn on logging for this library some log output is written to the database file. But I have absolutely no idea how this mixup can happen. If I switch off logging everything works as expected. I also know now why it works on Windows. This library is HW-dependent and therefore not running on my PC. Still clueless Michael ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Strange "database disk image is malformed" problems
Hello! I am currently integrating sqlite 3.7.3 into my application running on an embedded PowerPC-based Linux 2.6. I have the reproducable situation that I get the database file gets corrupted. Here is the list of operations: sqlite3_open (new database file is created) sqlite3_exec: create tables, indices, ... sqlite3_exec: a few inserts sqlite3_prepare_v2, sqlite3_step, sqlite_column_*, ...: to read data Until I close the database I can successfully insert/delete/select rows sqlite3_close sqlite3_open (existing file is opened) The only operation which works is reading data sqlite3_prepare_v2, sqlite3_step, sqlite_column_*, ...: to read data All insert or delete operations result in the "database disk image is malformed" message and I can not open the file with sqlite3 either (reports "Error: unsupported file format"). At this time it is also not possible to do a "pragma integrity_check". If I try to reproduce this sequence using sqlite3 the problem does not occur (qed). journal mode is default and there is no other file (journal, ...) than the specified databasefile. Using the same code under Windows 7 (VS2008) everything works fine. I have no idea where to look Do you have any ideas? Thanks in advance Michael Steiger ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users