sqlite

Huge (20 digits) Primary keys and SQLite

If I try to insert data with a 20 digit primary key into a SQLite database I get an error with the second insert statement because it "is not unique". If I select the values I can see from the SQLite commandprompt that the primary key is written in scientific notation. The column type is decimal. Is there a way to force SQLite to insert...

How can I capture modifier keys while starting a Delphi app to force some behavior

I'm writing an application in Delphi which uses an SQLite3 database. I'd like to be able to start the application while holding some modifier keys, such as CTRL + SHIFT, to signal reinitialization of the database. How can I capture that the application was started while these keys were held? ...

Using SQLite in a Python program

I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in production. What I'm try...

What's the best way to get the last inserted id using sqlite from Java?

What's the best way to get the last inserted id using sqlite from Java? Google is giving me different answers--some say select the last-insert-rowid; others say call statement.getGeneratedKeys(). What's the best route to take? (I just want to return the id, not use it for other inserts or anything.) ...

Tips for optimizing an sqlite database with over a gig of data in it?

I am working with a larger than average sqlite database (for use on both on windows and linux) and am looking to maximize the performance I get out of it. The database is to be installed on commodity hardware along with an sqlite gui. The users I am delivering this to are sql savvy but are unlikely to undertake their own optimizations (c...

SQLite parameter substitution problem

Using SQLite3 with Python 2.5, I'm trying to iterate through a list and pull the weight of an item from the database based on the item's name. I tried using the "?" parameter substitution suggested to prevent SQL injections but it doesn't work. For example, when I use: for item in self.inventory_names: self.cursor.execute("SELECT w...

Cannot import SQLite with Python 2.6

I'm running Python 2.6 on Unix and when I run the interactive prompt (SQLite is supposed to be preinstalled) I get: [root@idev htdocs]# python Python 2.6 (r26:66714, Oct 23 2008, 16:25:34) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite Trace...

What's the best zero (near zero?) administration relational database for a windows desktop app: Access, SQLite, SQL Server, other?

We don't need multiuser. Just relational. Our app currently uses Access but Access isn't exactly zero-administration because it's prone to corruption. Is SQLite rock, rock solid, pure zero-administration? Or...is there a way to configure SQL Server as a desktop engine so that it is pure zero admin? Or...is there some othe...

Finding the difference in rows in query using sqlite

After a few hours of searching, I'm not getting anything that works with Sqlite. It's driving me nuts. I have an sqlite table that contains prices for various products. It's a snapshot table, so it contains the prices on 5 minute intervals. I would like to write a query that would return the difference in price from one row to the next ...

How could I store Image retrieved from web, into application bundle?

Hi I am developing iPhone application and In that application I've one TableViewController, and that TableViewController made up of Custom table cell. into those cell I am loading image from URL, but the scrolling is not that smooth,(because each cell load images everytime when scrolling happen.) So I decided to store those images into...

Any way to enforce numeric primary key size limit in sql?

I'd like to create a table which has an integer primary key limited between 000 and 999. Is there any way to enforce this 3 digit limit within the sql? I'm using sqlite3. Thanks. ...

LINQ with SQLite (linqtosql)

I have a small project that require a storage (I choose SQLite) and I got good result with the ADO DLL for .Net for Sqlite. After the Install, I noticed that it contain a SQLLinq.dll. Before investigating too much effort, and because I haven't see any good example on the web, I would like to know if anyone got any good result with SQLit...

How do I find the length (size) of a binary blob in sqlite

I have an sqlite table that contains a BLOB file, but need to do a size/length check on the blob, how do I do that? According to some documentation I did find, using length(blob) won't work, because length() only works on texts and will stop counting after the first NULL. My empirical tests have shown this to be true. I'm using SQLite ...

Persisting Dates to SQLite3 in an iPhone Application

I am developing an iPhone application that persists data to a SQLite3 database. For each row I persist I wish to include a 'created date' and a 'last modified date' My question is what is the recommend approach for storing this information in a table? The properties are represented as NSDate in my application but I am unsure how to ...

Sqlite Optimization: Read only scenario

I use SQLite for a number of application on the desktop and PDA. Most operations are readonly, as SQLite functions as a data store for reference material in my applications. Basically, I am looking for suggestions on improving performance in a scenario where you know the access to the data is only read-only. Maybe via various pragma se...

How to change character encoding of a PDO/SQLite connection in PHP?

I'm having a little problem with a php-gtk app that keeps running into non-utf8 strings, I had found that the problem is in the database connection, even when the database is supposed to be in UTF-8. I had tried with the "SET CHARACTER SET utf8"(MySQL way) and the "SET NAMES UTF8" and nothing happen (there isn't any information about no...

Is there a speed difference between sqlite3 and mysql?

After much googling I have been wondering what the benefits/differences are between mysql and sqlite3. I am primarily hoping for a speed bump when moving my development database to my production database, although I imagine this will primarily happen in my code. Does any know what the major differences are in performance? ARE there? Or w...

Database change underneath SQLObject

I'm starting a web project that likely should be fine with SQLite. I have SQLObject on top of it, but thinking long term here -- if this project should require a more robust (e.g. able to handle high traffic), I will need to have a transition plan ready. My questions: How easy is it to transition from one DB (SQLite) to another (MySQ...

Updating sqlite3 API for Objective-C

I want to update/upgrade the standard Leopard install of Sqlite3 to >3.5 to use the new sqlite_xxx_v2 methods from a Cocoa project. I can't seem to find any information on how to do this. Does anyone have any tips or a site that outlines the update procedure. Also is 3.5+ supported on the iPhone. I understand it's embedded so shouldn'...

Full text search on a mobile device?

We'll soon be embarking on the development of a new mobile application. This particular app will be used for heavy searching of text based fields. Any suggestions from the group at large for what sort of database engine is best suited to allowing these types of searches on a mobile platform? Specifics include Windows Mobile 6 and we'll ...