sqlite

SQLite and `Object reference not set` exception

edit2: solution http://stackoverflow.com/questions/1710941/sqlite-and-object-reference-not-set-exception/1711481#1711481 I am having a hard time understanding my error. edit1: I set my define to make my code single threaded. The problem went away. So it seems like a race condition. I get the error below. But not always, i notice that ...

How get datetime column in sqlite objecite-c

Hi, How do you get a datetime column in sqlite objective-c ? I have a table with 4 fields: pk, datetime, value1 and value 2. pk (primary key), value1 and value2 are integer so I am using: int value1 = sqlite3_column_int(statement, 2); int value1 = sqlite3_column_int(statement, 3); But what should I used for datetime? Thx ...

How do I improve the performance of SQLite?

Optimizing SQLite is tricky. Bulk-insert performance of a C application can vary from 85 inserts-per-second to over 96 000 inserts-per-second! Background: We are using SQLite as part of a desktop application. We have large amounts of configuration data stored in XML files that are parsed and loaded into an SQLite database for further p...

How to insert duplicate rows in SQLite with a unique ID?

This seems simple enough: I want to duplicate a row in a SQLite table: INSERT INTO table SELECT * FROM table WHERE rowId=5; If there were no explicit unique column declarations, the statement would work, but the table's first column is declared rowID INTEGER NOT NULL PRIMARY KEY. Is there any way to create a simple statement like the...

Should I use sqlite3_finalize after i performed a query with sqlite3_exec?

Hi, I'm using Sqlite3 in my iPhone app, I was getting some unwanted rollbacks apparently in a random basis, However I don't know if this has something to do with the fact that I don't finalize the statements with sqlite3_finalize, since as far as I know sqlite3_exec takes care of it. Also I found some SELECTs with sqlite3_prepare_v2 tha...

Synchronizing filesystem and cached data on program startup

I have a program that needs to retrieve some data about a set of files (that is, a directory and all files within it and sub directories of certain types). The data is (very) expensive to calculate, so rather than traversing the filesystem and calculating it on program startup, I keep a cache of the data in a SQLite database and use a Fi...

Determine if SQLite3 transaction is active

I am running an END TRANSACTION on my database and occasionally I get error #1 that "cannot commit - no transaction is active" Is there a way to determine if a transaction is active before trying a commit? I have been tracking my "BEGIN TRANSACTIONS" by hand but I feel there is a better way. I am using the C API ...

how to store blob data in sqlite database from javascript with google gear ?

Hi, We have a very special requirement to store blob data in SQLite database, where We have to store documents. We have static html page which is in user disk, so we want user to upload document without connecting to internet with help of google gear, javascript and SQLite. is it possible to do ... Any Help Appreciated ... ...

HTML5 DB error callback, how to know the sql request throwing error ?

I use the html5 database in safari like that (simplified code) : createContent : function() { this.database.transaction(function(transaction){ for (var elm in lotOfElm) { transaction.executeSql('INSERT....VALUES (?, ...?)', [elm.att1, elm.att2...], nullDataHandler, errorHandler); } }); }, errorHandler: fun...

iphone best way to store images

hello, I'm developing an app that needs to cache some images from the web the images are likely to be 100x100 I just need to know which is better: Store the images as files in the iPhone file system Store them as blob in a sqlite Db along with other data already saved on the database. Appreciate your help. ...

How to make string keys unique by adding numeric suffix?

I have a table with two columns n integer and s varchar. n is the primary key. s is mostly unique but not always. For example n s 1 New York 2 Moscow 3 Paris 4 London 5 Moscow 6 Berlin 7 Moscow I want to create another table with the same structure, the same number of rows except that s will be made unique by adding nu...

Is this file lock issue due to me copying the DB file for every MSTest test? (using DeploymentItem annotation)

Hi, BACKGROUND: I've running unit tests in VS2008 using MSTest. My project has a SqlLite database. I have found that I needed to arrange for the default database file to be copied to the MSTest area for the test to be able to find it. I am using the following annotation about the test code to arrange this: [DeploymentItem("dat...

does android support JDBC

Hi all I know that on android there is android.database.sqlite package that provides helpfull classes to manage the internal android database. The question is - can i use the standard java.sql package to manipulate android's database without using anything from android.database.sqlite.* I try to open connection using sqlite JDBC driver...

How to emulate tagged union in a database?

What is the best way to emulate Tagged union in databases? I'm talking about something like this: create table t1 { vehicle_id INTEGER NOT NULL REFERENCES car(id) OR motor(id) -- not valid ... } where vehicle_id would be id in car table OR motor table, and it would know which. (assume that motor and car tables have nothing in com...

Entity Framework with File-Based Database

I am in the process of developing a desktop application that needs a database. The application is currently targeted to SQL Express 2005 and works wonderfully. However, I'm not crazy about having this dependency on SQL Express and would prefer to use a small file-based database. My problem is that I am using Entity Framework. I have ...

Reason for slow Adobe AIR app performance?

I am trying to debug a strange problem with Windows XP (SP3) Adobe AIR performance. Our app syncs data from a remote server to a local SQLite database, and on certain machines, this process takes 15 minutes or more. It should take, at most, a few minutes. We've done enough investigating to come to the conclusion that is definitely re...

Where is an application's Core Data sqlite database file located?

I would like to write a method that deletes my application's Core Data store, which I would follow by creating a new store. Is there a standard approach for doing this, and where is the database located in my application's sandbox? ...

How to delete data from multiple tables in sqlite?

I am using sqlite database to store data. I have three tables: Invoice, InvRow, Invdetails. Relationsip between the tables are: Invoice.Id = InvRow.InvId InvRow.Id = Invdetails.RowId I need to delete related entries from three tables using a single query. How can I do that? Any help? ...

Installing SQLite 3.6 On Windows 7

How do I install SQLite 3.6 on Windows 7? I extracted sqlite3.exe, sqlite3.dll, and sqlite3.def to C:\Windows\System32 but when I try to run a Ruby program that requires the use of sqlite3, I get this error: The program can't start because sqlite3.dll is missing from your computer. Try reinstalling the program to fix this problem. ...

How can I migrate my data from my rails app from mySql to SQLite

How can I migrate my data from my rails app from mySql to SQLite? Is this possible? ...