sqlite

NHibernate one-to-many different between SQLITE and Oracle

I have a one-to-many mapping that works in sql lite, but then blows up in Oracle. If I make a slight change, it will work in Oracle, but not in SQLITE. Here's my mappings: This works in SQL Lite <many-to-one class="NHibernate.Spike.Data.Entities.ClientRecord, NHibernate.Spike.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nul...

Index for BETWEEN function in SQLite

I'm working on an analysis application which operates on datasets up to 10,000,000 entries. I'm only writing to this database during initial import, not afterwards. Right now this dataset is stored in SQLite - mostly for speed reasons. Unfortunately, I find the speed disappointing, mostly because SQLite can't use indexes queries like ...

Multiple-reference foreign keys in table definition?

Summary How do I make it easy for non-programmers to write a query such as the following? select table_name.* , foreign_table_1.name , foreign_table_2.name from table_name left outer join foreign_table foreign_table_1 on foreign_table_1.id = foreign_1_id left outer join foreign_table foreign_table_2 on foreign_table_2.id = fo...

How can I optimize multiple nested SELECTs in SQLite (w/Python)?

I'm building a CGI script that polls a SQLite database and builds a table of statistics. The source database table is described below, as is the chunk of pertinent code. Everything works (functionally), but the CGI itself is very slow as I have multiple nested SELECT COUNT(id) calls. I figure my best shot at optimization is to ask the SO...

sqlite & flex - insert into if not exists?

I'm using flex to develop my first desktop app and I'm working with sqlite for the first time as well. I'm creating my database and all the tables and I would also like to add a few rows of data into a couple of the tables so that the users have some data to work with on first install. The only problem I'm having is every time I run ...

android database encryption

android uses sqlite database to store data, I need to encrypt the sqlite database, how can this be done? I understand that application data is private. However I need to explictly encrypt the sqlite database that my app is using. ...

sqlite & flex - insert into or ignore problem

I'm using flex to develop my first desktop app and I'm working with sqlite for the first time as well. I'm creating my database and all the tables just fine, but I would also like to add a few rows of data into a couple of the tables so the information is present on first install. The only problem I'm having is every time I run the pro...

What's the best way to utilize static data in an AIR application?

I'm building my first AIR application after two years of building Flex applications with a SQL Server database, using ColdFusion CFCs and .NET as WebService interfaces. I want to create an AIR application with static data and I'm trying to figure out the best way of doing this, and how to do this. I have several related pieces of data. ...

Android: SQLite one-to-many design

Anyone has good advise on how to implement one-to-many mapping for SQLite using ContentProvider? If you look at Uri ContentProvider#insert(Uri, ContentValues) you can see that it has ContentValues param that contains data to insert. The problem is that in its current implementation ContentValues does not support put(String, Object) metho...

Django unable to open sqlite on SOME queries only?

I have had no troubles locally, but pushing a new project to an existing machine (one running plenty of other django apps without trouble) gave this: OperationalError: unable to open database file What is more perplexing is: The sqlite file is read-write for all This error only happens on some queries! Other's are fine. In a fresh d...

SQLite3 and Alter table .. after ..

Is there a simple way to modify a table in recent sqlite versions so that it matches a predefined schema? Schema: war_id INTEGER NOT NULL, clanname VARCHAR(64), clanhomepage VARCHAR(128), date DATETIME, server VARCHAR(64), warmode_id INTEGER, squad_id INTEGER, notes TEXT, clantag String(16), PRIMARY KEY (war_id), FOREIGN KEY(w...

compile SQLite amalgamation for Windows Mobile device

How can I compile the SQLite amalgamation for Windows Mobile device? Then I want to use in a console to run some commands. I've created an empty VS project in C/C++ for Smart Device, then included the existing files into Sources and Headers. When I try to compile I get: Error 1 error LNK2019: unresolved external symbol wmain referen...

Using custom file for Android sqlite database

Is it possible to choose a custom location for the sqlite database file? If possible I want to store the database file in the memory card. And if user switches from one memory card to the other I want my application to use whatever version of the database file available on the card. ...

How do I read Safari's cache.db through Active Record?

What I Want I want to read the cache of Safari through Active Record. Essentially, I want to peek inside the cache like this except from within a Rails app. What I've Tried I copied the Cache.db file I set up the environment.rb file in a new Rails app with the path of a copy of the Safari Cache.db SQLite Database. Ran db:migrate Thi...

SQLite Update date sql

SQLite Newbie I am trying to update a table with a date. Something like this: Update MyTable Set MyCol=GetDate() What is the correct syntax? ...

SQLITE INNERJOIN Nightmare, need a solution to this.

Dear fellow members, It's nice to find such a useful site with genius members. I have been trying to find a solution for this SQLITE problem for a while now. Google didn't help me, except in finding this website. The SQL query works fine on the MSAccess version of the same database. Here's my SQL statement - which didn't work for me. ...

ant sql task throws "no ResultSet available" with org.sqlite.JDBC driver

I'm trying to use org.sqlite.JDBC to create and update a sqlite database in ant. The sqlitejdbc-v056.jar comes from http://www.zentus.com/sqlitejdbc/ and is the latest version (056) This is my build.xml: <?xml version="1.0" encoding="utf-8"?> <project name="My Project" default="mytarget" basedir="."> <path id="antclasspath"> ...

Is there any C SQLite API for quoting/escaping the name of a table?

It's impossible to sqlite3_bind_text a table name because sqlite3_prepare_v2 fails to prepare a statement such as: SELECT * FROM ? ; I presume the table name is needed to parse the statement, so the quoting needs to happend before sqlite3_prepare_v2. Is there something like a sqlite3_quote_tablename? Maybe it already exists under a n...

SQLite: date stored as integer, comparision fails.

Hi, I have kind of strange problem ... I have a table which stores a timestamp as integer (realdate field). Now there are the results of selecting items younger than some date: SELECT realdate FROM photos WHERE realdate > 1265410800 array 0 => array 'realdate' => string '1265629201' (length=10) 0 => string '12656...

Does spec tests migrate dbs on every test?

I did rake test:prepare and clone the db. Then when I do spec spec/controllers/file, it migrates the db every single time. Is that supposed to do that? I thought it was only supposed to migrate the dbs once. Thanks ...