sqlite

Problem of SQLite3::SQLException: SQL logic error or missing database

Hi, I met SQLite3::SQLException: SQL logic error or missing database error when do insert, update and delete operation to tables from browser( that means the create, update and destroy action is failed but the show action is fine ), the same operation in console is OK. I googled this problem and found most of the solutions is to...

Python sqlite3 and concurrency

I have a Python program that uses the "threading" module. Once every second, my program starts a new thread that fetches some data from the web, and stores this data to my hard drive. I would like to use sqlite3 to store these results, but I can't get it to work. The issue seems to be about the following line: conn = sqlite3.connect("my...

Adobe Air/Flex + SQLite database problem

I'm still a newbie to Adobe Air/Flex, and still fairly new with SQL. I've downloaded this (http://coenraets.org/blog/2008/11/using-the-sqlite-database-access-api-in-air…-part-1/) code and have been looking over it and I'm trying to implement the same idea. I think it's just something stupid. I'm using Flex Builder. I made a new deskto...

How to reduce the size of an sqlite3 database for iphone?

edit: many thanks for all the answers. Here are the results after applying the optimisations so far: Switching to sorting the characters and run length encoding - new DB size 42M Dropping the indexes on the booleans - new DB size 33M The really nice part is this hasn't required any changes in the iphone code I have an iphone applica...

SQLite for read-only applications?

Will SQLite work OK for a multi-user read-only application where the database resides on a Windows network drive? ...

Install default database with AIR app

I want to ship a default SQLite database, with some predefined key/value pairs in a table, along with an Adobe AIR application. What is the best method to accomplish this? In my mind, this would be as simple as updating an xml file and rebuilding the application. I've come across this solution but it looks a little hackish to me (having ...

SQLite3: Insert BLOB with NULL characters in C++

Hi everyone, I'm working on the development of a C++ API which uses custom-designed plugins to interface with different database engines using their APIs and specific SQL syntax. Currently, I'm attempting to find a way of inserting BLOBs, but since NULL is the terminating character in C/C++, the BLOB becomes truncated when construct...

Strange results from OdbcDataReader reading Sqlite DB

This method returns some strange results, and was wondering if someone could explain why this is happening, and possibly a solution to get my desired results. Results: FileName = what I'd expect FileSize = what I'd expect Buffer = all bytes = 0 BytesRead = 0 BlobString = string of binary data FieldType = BLOB (what I'd expect) Co...

SQLite 3 C API Transactions

I am using SQLite3 for iPhone development and I'm attempting to wrap a few insert statements into a transaction. Currently I have the below code which is working properly however after reading another question on SO I realized it would be better to have these in one transaction rather than one each. I couldn't find the C API call to begi...

Alternatives to SQLite?

I've used SQLite before as a datastore for a C# winforms application, and it was great, however, it does possess many shortcomings. I'm aware Microsoft have a product called SQL Server Compact Edition - does this work in the same way SQLite does, and if so, is it any good? Are there any other alternatives? Update By alternatives I me...

SQLite - UPSERT *not* INSERT or REPLACE

http://en.wikipedia.org/wiki/Upsert http://stackoverflow.com/questions/13540/insert-update-stored-proc-on-sql-server Is there some clever way to do this in SQLite that I have not thought of? Basically I want to update three out of four columns if the record exists If it does not exists I want to INSERT the record with the default (NU...

Why can't I install the sqlite gem?

I'm try to install the sqlite gem on a Fedora 9 Linux box with ruby 1.8.6, Rails 2.2.2, gem 1.3, and sqlite-3.5.9. Here's the command I'm running and its results: sudo gem install sqlite3-ruby Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. ...

keeping a log table in sqlite database?

I'm looking for a way to set up (via SQL) a log table containing everything that had been done to my sqlite database (preferably in terms of the insert, create table etc. statements as issued to the database). I'm sure there are way to do it via setting trigger on each table, but that is just WAY too much work and does not bode well if I...

How to log SQLite queries on iPhone

Hi, I'm doing an iPhone application, and I'm using SQLite. The problem is that I had some issues with the query (I did bad binding) so, this is my question: How can I log in my iPhone application the effective SQL query/statement with the bindings that SQLite receives? Thanks. ...

How do you rename a table in SQLite 3.0?

How do you rename a table in SQLite 3.0? ...

Using pointers in Objective C for NSMutableArray objects

When retrieving objects from an NSMutableArray in cocoa-touch is the below code ok? Should I be allocating([alloc]) new Page objects each time or is just pointing to it alright? Do I need to do anything to the Page *pageObj after, such as set it to nil? const char *sql = "insert into Page(Book_ID, Page_Num, Page_Text) Values(?, ?, ?)"; ...

Is there is a software caching API out there?

Hi all, I'm looking for an API or an application that can cache data from a file or database. My idea is that I have an application that reads a database, but the access to database is sequential and it is on a disk. What I basically want to do is get the data from cache first and then if it doesn't exist in cache, then hit the databas...

How do I use prepared statements in SQlite in Android?

How do I use prepared statements in SQlite in Android? ...

Memory management when using sqlite database in iphone

Hi My application makes use of a SQLite database to store the user's inputs. The number of records in the input would go to around 100 records and I have a lot of SQL operations going on in the application. When I run the application with Object Allocations, it shows the sqlite library libsqlite3.0.dylib using up a lot of memory. Does ...

How to add additional information to a many-to-many relation?

I'm writing a program to manage orders and then print them. An order is an object containing the ordering person, the date and the products this person orders. I'd like to add the amount of a certain product one orderer. E.g. 3 eggs, 2 breads. Is there a simpler way doing this with storm (the ORM I'm using) than splitting the order int...