sqlite

Sqlite source code reading. What the ids like F17025, U17032 are used for?

In SQLite source code comments I see identificators like F17025, U17032, etc. sqlite3.c: ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt ** to enter a mutex. {F17024} If another thread is already within the mutex, ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return ** SQLITE_BUSY. {F17025} Th...

Can this select query be optimized more on a mobile device?

We have a C# mobile application with SQLite database. We are having a larger inventory database, such as 30k or 100k items. The database file is 12MB on a flash memory card. Running a simpler SELECT query with limit takes 10-15 seconds. select id,invitem,invid,cost from inventory where itemtype = 1 and (invitem like '%5204d%' o...

Reading Firefox Bookmarks

Apparently, latest Firefox versions stores its bookmarks in a file called 'places.sqlite'. Like a browser can import the bookmarks from another browser, I would want to import the bookmarks to a file, but I need to know what would you need to do it? ...

Duplicate Android database from another application?

I have two versions of the same application. When people upgrade from the free version to the paid version I'd like the free database to be copied to the pro database location. Is there a way I can access the database file itself if it belongs to another application? Does the file even belong to the application or is it generally acces...

Datatype mismatch issue in a Parametrized insert query

I have this code to transfer records from one-table to the other cmd2.CommandText = "select * from " + TableName; reader = cmd2.ExecuteReader(); if (reader != null) { String s = "".PadLeft(reader.FieldCount - 1, 'X').Replace("X", "?,") + "?"; ...

How to add default value in SQLite?

I had a table modified to add status column to it in this fashion ALTER TABLE ITEM ADD COLUMN STATUS VARCHAR DEFAULT 'N'; However SQLite doesnt seem to add N to the column for any new ITEM created. Is the syntax wrong or is there any issue with SQLite and its support for defaults. I am using SQLite 3.6.22 ...

iPhone App fails to properly ??copy? database file ONLY with ad-hoc or app-store distribution and NOT in development mode.

Hi, I just submitted this to Apple Support, but I'm wondering if anyone here has encountered something similar. SUMMARY: my iphone app crashes when downloaded from the iTunes app store or from an ad-hoc distribution, but doesn't "crash" when run in debug mode on the simulator or on my iPod DETAILS: The app contains a rather large sqli...

Nested statements in sqlite

I'm using the sqlite3 library in c++ to query the database from *.sqlite file. can you write a query statement in sqlite3 like: char* sql = "select name from table id = (select full_name from second_table where column = 4);" The second statement should return an id to complete the query statement with first statement. ...

Multi-Column Integer Ordering

I don't know if I've chosen the appropriate title for this question (if not, please change it accordingly) but consider the following simplified table structure I'm working with: ---------------------------------------------- | date | i | j | k | x | y | z | ---------------------------------------------- | 100209 | 1 | ...

XML and SQLite memory utilization and performance on the iPhone

How do the memory utilization and performance for XML or SQLite compare on the iPhone? The initial data set for our application is 500 records with no more than 750 characters each. How well would XML compare with SQLite for accessing say record 397 without going through the first 396? I know SQLite3 would have a better methods for tha...

Decimal points in sqlite table?

I'm trying to get a float to show up with the decimal point in my sqlite table. I've included the code below for how it shoes up in the game which is all fine. As well as for what happens at the end of a level. And how it gets updated to the sqlite table. It shoes up fine as a decimal during the game, but it gets recorded to the tabl...

How do I Increase the speed of this sqlite db query / object creation in Objective-C?

Hi, I have the following method which queries a sqlite db table on the iPhone it pulls about 6,000 rows from the table and then cycles through those creating 6,000 objects based on the information and stuffing them into an array. The while loop is somewhat slow (takes ~ 10 seconds to iterate through them on my device) Any thoughts on ho...

Android ExpandableListActivity and SimpleCursorTreeAdapter?

Hi! I'm writing a simple application for Android. I have 2 tables - one called 'grous' and another called 'group_items'. I want to use expandable list to display data from both tables. What is the best way to do it? Is it possible to map data by using SimpleCursorTreeAdapter? I couldn't find any usefull examples. I saw the examples c...

Why is SQLite fit for template cache?

The benefits of using SQLite storage for the template cache are faster read and write operations when the number of cache elements is important. I've never used it yet,but how can using SQLite by faster than plain file system? IMO the overhead(initiating a connection) will make it slower. BTW,can someone provide a demo how t...

Copy local SQLite Database to iPhone?

Hi there, i am doing some experiments with coredata and objective-c. My application works fine in the simulator. It also works on my iPodTouch. But how to i copy my local database to my device? thanks, ...

Using SQLite for configuration management

I'm developing a PHP application where I have to store configuration variables. Using MySQL would be overkill, because it's a CLI app I'm talking about and there are only a couple of configuration variables. I don't know about INI files... I'm thinking of using SQLite. What do you think? It is too overkill using SQLite? Do you sugges...

How do I address warnings when compiling SQLite with VC++?

Whenever I compile SQLite with Visual C++ 9 I get hundreds of warnings, such as potentially uninitialized variables conversion from wider integer types to narrower integer types signed/unsigned integers mismatches. I'm not alone - there's an SQLite FAQ question specifically about that. The answer to that question says that those wa...

iPhone App With SQLITE FTS3 Xcode Release Build Not Working

My iPhone application uses SQLITE's FTS3 functions (specifically MATCH and OFFSET). These are essential to my optimized searching algorithm. I implemented FTS3 by including three SQLITE source files, namely sqlite3.c, sqlite3.h and sqlite3ext.h in my project, under a group named SQLite. I removed from the Frameworks group my previous ref...

SQLite, can't delete columns

Hi, i have set a content provider, for some reason I am able to to delete a row this way: getContentResolver().delete(myUri, "_id=" + "3", null); but i am not able to delete a row that way: getContentResolver().delete(myUri, "NAME=" + "chris", null); getting this error: 02-15 15:48:08.197: ERROR/AndroidRuntime(3043): android.dat...

What administration tasks (if any) should I perform on a sqlite database?

I'm deploying a client application to several thousand windows machines. Each machine will use a sqlite database as a local datastore, ultimately writing data to a remote server. So the sqlite db won't really grow over a few MB over time, since data will be added and then later deleted. SQLite is supposed to be zero-administration, but a...