sqlite

SQLite error when loading two python scripts simultaneously

I have two python scripts that have to run simultaneously because they interact with each other. One script is a 'server' script running locally and the other is client script that connects to it via a socket. Normally I just open a couple terminal tabs and run the server script in one and the client in the other. After starting and stop...

NSURL code to display an image from a sqlite table

Ii'm using this NSURL code to display an image. what I want to do is to insert a url from my database table in place of the static url shown in the code below: Does anyone know how I should proceed? NSURL *url = [NSURL URLWithString:@"http://www.nyapplecountry.com/images/photosvarieties/redrome04.jpg"]; UIImage *image = [UIImage imageW...

iPhone + sqlite3 + fmdb, What code do i need to put data into a UiTableView datasource?

If I was adding data from an array to the UITableView datasource array I'd use this, in viewDidLoad. NSMutableArray *array = [[NSArray alloc] initWithObjects:@"Head First Design Patterns", @"Head First HTML & CSS", @"Head First iPhone", nil]; self.transactionsArray = array; [array release]; And this in cellForRowAtIndexPath NSInteger...

SQLite: select for update wait 10 compatibility

SQLite doesn't support nor accept such a query: select * from mytable where col = 'val' for update wait 10; Do you know if there is a way to make SQLite silently skipping the part "for update wait 10" and thus avoid any parsing error. My point is to get Oracle SQL commands barely working against SQLite without having to manually edit t...

Android: Saving Image to Database

I have a activity with 3 imagesViews and a Button. Clicking on the ImageView shows an AlertDialog with a list of images (located in /res/drawable) that the user can select. I've hit a wall where I don't know how to store the images to the database that were selected in the ImageViews. Any pointers? ...

CoreData/SQLite fastest way to determine if a field doesn't end with a particular string

I'm using CoreData backed by SQLite and I'm trying to find the fastest way to exclude rows where the field AirDate ends with -00-00 I've noticed that [NSPredicate predicateWithFormat:@"NOT AirDate CONTAINS %@", @"-00-00"] is much faster than [NSPredicate predicateWithFormat:@"NOT AirDate LIKE %@", @"*-00-00"] Are there any other o...

SQLite3 group by using columns, not rows

What's the easiest way to fix this sqlite3 query so that wins and losses show up as columns in a single row instead of in two separate rows? http://0890db80061d7d2b33eb4606a4c301c1.conquerclub.db.94y.info/ I can think of hard ways involving subselects, but surely there's an easy/efficient/beautiful solution here? I want to avoid so...

Finding Auto Incremented values from an INSERT OR IGNORE statement in SQLite

I have a table called "images": CREATE TABLE images ( id INTEGER PRIMARY KEY AUTOINCREMENT, url TEXT NOT NULL UNIQUE, caption TEXT ); On inserting a row, I'd like the URL column to be unique. At the same time, I'd like to find out the id of the row with that URL. INSERT OR IGNORE images (url, caption) VALUES ("h...

SQL query to obtain a count of how many items have each possible value for a given column

Okay, so I have a (SQLite) table called log wherein one column (time) is a Unix epoch timestamp (the other columns are irrelevant for my purposes). These are timestamped log entries. I am trying to get a count of how many items are logged per hour (all-time -- I don't care to do it only for a given day or whatever; I'm trying to get an ...

OnUpgrade not using drop table/create table/insert into

I really like this approach for handling sqlite database when developing for Android but I have a question when it comes to upgrading the database during an upgrade of the application. Is this method recommended or is it so much safer to do the standard procedure (as it seem to be) with drop table/create table/insert into, within a trans...

Cannot run mspec.exe with Syste.Data.SQLite.dll x86, but it works in R# MSpec runner

Hi, I use mspec for my tests and have a NHiernate Setup using SQLite x86 for my database in the tests. The problem is that when i run my test using the mspec r# runner everything works fine but running it from the console thwors an error that it cannot find the sqlite dll. My config of the specification projects: .net 4 x86 (using th...

Very simple SQL query on varchar fields with sqlite

Hi! I created a table with this schema using sqlite3: CREATE TABLE monitored_files (file_id INTEGER PRIMARY KEY,file_name VARCHAR(32767),original_relative_dir_path VARCHAR(32767),backupped_relative_dir_path VARCHAR(32767),directory_id INTEGER); now, I would like to get all the records where original_relative_dir_path is exactly equal ...

is it possible to use more than one SQLite files in CoreData?

Hello fellow stackoverflow family members? I know it is un-efficient to create one extra sqlite table in iPhone CoreData system. (X) Currently, My app has one sqlite table but there are preset data to users to no need to waste parse time. But if I adding new entity in current structure of SQLite table, it wipes up the whole preset data...

Distinct values in Android ExpandableListView

Hi all, I'm having trouble with an ExpandableListView. What I want is for each group to be from column "bond", which is non-unique, but I want the groups to be unique (i.e. each value of "bond" should only have one group). Each value in the group has data in other columns which should be displayed. The problem is that it seems I can eit...

SQL: Select first row in each a GROUP BY group?

As the title suggests, I'd like to select the first row of each set of rows grouped with a GROUP BY. Specifically, if I've got a "purchases" table that looks like this: > SELECT * FROM purchases: id | customer | total 1 | Joe | 5 2 | Sally | 3 3 | Joe | 2 4 | Sally | 1 I'd like to query for "the id of the largest...

how to read a sqlite3 decimal column?

I can read a text and an int column (sqlite3_column_text, sqlite3_column_int). But does anyone know how to read in a sqlite decimal column? The decimal columns essentially hold currency values. Thanks! ...

Using python in android to interface to sql

I know you can use python and other scripting languages in android. But I haven't seen weather or not it was possible to use python as an interface to sqlite in android. Is this possible? This is the first android app where I've needed sqlite, and using the java api's is retarded. If this isn't possible, can someone point me to a good t...

Where to begin reading SQLite source code?

Hi, I want to understand how sqlite is implemented. And, want to read the source code( I have already downloaded the source). Which part of the code I should start looking at? ...

Sqlite with C# on Vista

I am using Sqlite as DataBase in my app. I have a table totalcount when i execute the "select hitcount from TotalCount" it is giving the default value in vista while run as administrator it is giving the correct result. Please suggest ...

FILESYSTEM vs SQLITE, while storing up-to 10M files

I would like to store up-to 10M files, 2TB storage unit. The only properties which I need restricted to filenames, and their contents (data). The files max-length is 100MB, most of them are less than 1MB. The ability of removing files is required, and both writing and reading speeds should be a priority - while low storage efficiency, r...