sqlite

NHibernate and SQLite: will an IgnoreCase() query be an indexed lookup or not?

The Foo column is defined as "Foo TEXT unique". Will an Eq().IgnoreCase() query use the index or will it perform a complete column scan? The query: string foo = "foo"; IList<T> list = session.CreateCriteria(typeof(T)). Add(Expression.Eq("Foo", foo).IgnoreCase()).List<T>(); ...

What is a maximum size of SQLite database on Android?

I have a SQLite db that size is over 2.6 GiB. (The db contains maps.) This db is used by RMaps app. When move the maps to some parts at maximum zoom, the app suddenly closes. However, there is no force close message, no report button. So, I've got an idea that it is caused by reading blocks that are beyond a certain limit e.g. max(int). ...

Data not inserting in Sqlite database in android

Hi, i am an android application developer. I am developing an application which requires of me to use Sqlite database. I have implemented fetching the data, but i am facing problems when i try to insert data into the Sqlite database. The problem that i am having is that the new data i enter is not fetched, i.e nothing is new is being ent...

Displaying results of a SQL join in a ListActivity

I need to display results from a SQL join in a ListView/ListActivity. I've created a cursor: Cursor cursor = db.rawQuery(LIST_JOIN_SQL, null); and if I iterate through the cursor, the results are exactly what I expect. However when I try and use a SimpleCursorAdapter to display these results in a ListView I get a runtime exception b...

Update database on CheckBox click in Android?

Here is my custom ListView item. The problem is that I want it to update my database whenever it is clicked. And to do that I need to get the row id of the ListItem of the CheckBox that was clicked. Also could you please post a code sample. ...

Mongodb - are reliability issues significant still?

Hi, I have a couple of sqlite dbs (i'd say about 15GBs), with about 1m rows in total - so not super big. I was looking at mongodb, and it looks pretty easy to work with, especially if I want to try and do some basic natural language processing on the documents which make up the databases. I've never worked with Mongo in the past, no w...

How do I update the field of a table with the count of another table? SQLite, Java, Android

Hi all. I'm getting an "Invalid Character Constant" under the " 'D " just after UPDATE. Any Ideas? ORIGINAL : public Cursor fetchAllJournals(String sort) { mDb.rawQuery(UPDATE 'DATABASE_JOURNAL_TABLE' SET 'KEY_JOURNAL_NOTES' = (SELECT COUNT(*) FROM 'DATABASE_HOMES_TABLE' WHERE 'DATABASE_JOURNAL_TABLE'.'KEY_JROWID' = 'DATA...

Saving a file in Flex Air

Hi there, I'm trying to copy my SQLite file that is used in my Air app to user's selected directory using var fileSaveDest:FileReference = new FileReference(); fileSaveDest.save(dbWorkedFile,'Inventory.DB'); dbWorkedFile is a File dbWorkedFile = File.documentsDirectory.resolvePath("Inventory.db"); I tried this but the saved file i...

Checking sqlite datetime NULL with RoR

Hi guys, RoR/SQL newbie here. My datetime column 'deleted_at' are all uninitialized. Running this query returns an error: SELECT * FROM variants v ON v.id = ovv0.variant_id INNER JOIN option_values_variants ovv1 ON v.id = ovv1.variant_id INNER JOIN option_values_variants ovv2 ON v.id = ovv2.variant_id INNER JOIN option_values_varia...

SQLite LIKE alternative for REGEXP, Match Start of Any Word

It does not seem possible to use REGEXP in a SQLite query in Android. If it is possible, please point me in the right direction. Is there a way to use a LIKE condition to query for an expression at the beginning of any word in the result? Example: Entries: 1. Minimum 2. Aluminum 3. Last Minute Query: "min" Desired Result (1)...

How to update DATETIME field with existing data from same table

I have an sqlite database which currently holds an integer field called Year which currently only stores the year. In future versions I want to store a full date and time. I updated my table to include a FullDate field using alter table. > ALTER TABLE Files ADD COLUMN UploadDate DATETIME DEFAULT 0; Next, I want to migrate all the ex...

Keep getting NullPointerExceptions when attempting to call getWritableDatabase()

Hi all, I'm new to the Android framework and I can't get past first base with SQLite. I'm trying to build a very simple application that has a EditText search box, which when a key is pressed performs a Like %word% search on a SQLite database for for the text entered in the EditText box, and displays the results in a ListView. N.B. the...

SQL: How to select 1st, 3rd, 11th and nth row from a table?

How to select 1st, 3rd, 11th and nth row from a table? ...

How can I use OrmLite with Android's default SQLite

I have a big problem using the default SQLite database via JDBC driver.I would like to use ORMLite with this.Let me expose my code: String databaseUrl = "jdbc:sqlite:/data/data/my.package.name/db.sqlite"; Class.forName("SQLite.JDBCDriver"); DriverManager.getConnection(databaseUrl); dataSource = DatabaseTyp...

sqlite SQL query for unprocessed rows

Hi, I'm not quite even sure where / what to search for - so apologies if this is a trivial thing that has been asked before! I have two tables in sqlite: table_A = [id, value1, value2] table_A$foo = [id, foo(value1), foo(value2)] table_A$bar = [id, bar(value1), bar(value2)] Where foo() / bar() are arbitrary functions not really rele...

SQLite: possible to update row or insert if it doesn't exist?

I'm sure I can check if a row exists by selecting it but I'm wondering if there's a slicker way that I'm just not aware of -- seems like a common enough task that there might be. This SQLite table looks something like this: rowID QID ANID value ------ ------ ----- ------ 0 axo 1 45 1 axo 2 12 If the combin...

Phonegap Database problem - storing images in the database

Hello - I am trying to make a very basic inventory application with the option to include a photo of items in the inventory. I have everything working except the photo part... I have looked at this http://phonegap.pbworks.com/iPhone%3A-Camera-API and I can get the camera to work, but do not seem to be able to add the image to the da...

SQLite string contains other string query

How do I do this? For example, if my column is "cats,dogs,birds" and I want to get any rows where column contains cats? ...

SQLite database issue in iOS 4

I have an application that has many users who can login and perform insertion, deletion and update operations on a database (SQLite 3.0). It works fine in iOS 3.1.2, but when i tried to run the same application in iOS 4.0, the application fuctions well for the first time (e.g. for the first time when a first user logs in). When he logs o...

SQL: How to improve performance when filtering rows based on foreign data?

Say I have a schema that represents a fixed-depth hierarchy like this: CREATE TABLE level0 ( id INTEGER PRIMARY KEY AUTOINCREMENT, text TEXT NOT NULL ) CREATE TABLE level1 ( id INTEGER PRIMARY KEY AUTOINCREMENT, text TEXT NOT NULL, level0_id INTEGER NOT NULL ) CREATE TABLE level2 ( id INTEGER PRIMARY KEY AUTOINC...