sqlite3

Sqlite on Android: How to create a sqlite dist db function - to be used in the app for distance calculation using lat, long

We are building an Android App that will use user's current location (lat, long) and show top 50 venues around the current location, sorted by distance. We have these venues stored in an SQLite DB. We plan to ship with the sqlite DB with the app. In order to fetch only the relevant top 50 closest venues, we want to define a db function...

ALTER TABLE Sqlite: how to check if a column exists before alter the table?

Hello everyone! I need to execute in python a SQL query that adds a new column, in sqlite3. The problem is that sometimes it already exists. So previous to executing the query I need to check if the column already exists. If it does, then I won't execute the query. Is there a way in sqlite to do that? Or do I have to make it throug...

Forms Authentification with sqlite

Hi, I have an ASP MVC-application that uses a SQL server express for and Forms authentication. The server im using does not have enough memory to run SQL Server express stable and I was thinking about migrating to SQLite instead. Is it possible to just migrate the existing aspnetdb-database from SQL Server to SQLite so that all my user...

How to force coredata to rebuild sqlite database model?

Hello, In my app I sometimes need to rebuild and repopulate database file. SQLite databse is created and managed by CoreData stack. What I'm trying to do is drop the file and then simply recreate persistentStoreCoordinator object. It works under simulator but not on device, where I'm getting such an error: NSFilePath = "/var/mobile/A...

Copying data from one sqlite db to another

Hello, I have 2 sqlite DBs with common data but with different purposes and I wanted to avoid reinserting data, so I was wondering if it was possible to copy a hole table from one DB to another. I didn't find anything about this on google regarding sqlite DB's so my hopes are not hi. Thank you, ...

SELECT INTO statement in sqlite.

HI Guys, Here I a wanna know that whether sqlite supports SELECT INTO statement. Actually I am trying to save the data in my table1 into table2 as a backup of my database before modifying the data. for that when I am using the SELECT INTO Statement a syntax error was generating as: My query as: SELECT * INTO equipments_backup FROM e...

Rails sqlite3 deploy problem

I'm trying to deploy a small rails app using sqlite3, but I keep getting the following exception: SQLite3::SQLException: unable to open database file. Permissions have been set to: -rwxrwxrwx 1 www-data root 208896 Mar 2 11:26 joboversigt.db I can read (select) from the database with no problem, put writing isn't working ...

Does the iPhone's SQLite implementation support the full SQLite 3 standard?

Does the iPhone's SQLite implementation support the full SQLite 3 standard? That is, is every function in the SQLite specification present and standard-compliant? If not, can someone point me to a document which explains what the differences are? Sorry if this is a repeat question. ...

Is there any string operators like the POSITION() method of MySQL available in SQLite3?

I didn't find it on their doc http://www.sqlite.org/lang_corefunc.html So just want to get confirm or options here. ...

Selection of rows related to a set of other rows.

Let's say, I have two tables, "entities" and "tags". Relation between them is expressed by third table "entity_tags", which have tho fields: entity_id and tag_id. And I want to select all entities sorted by it's relevance to the given set of tags. For example, there is "banana", "orange", "potato", "pen" and "car" as entities and I want ...

sqlite3 runs INSERT and UPDATE queries fine first time, but second time returns error.

Hi, the following code (from a database object created for each new view): -(void)update:(NSString *)queryText{ NSLog(queryText); char *errorMsg; if (sqlite3_prepare_v2(database, [queryText UTF8String], -1, } if (sqlite3_step(statement) != SQLITE_DONE){ NSAssert1(0, @"Error updating table: %s", errorMsg)...

Assertion failure when trying to write (INSERT, UPDATE) to sqlite database on iPhone.

I have a really frustrating error that I've spent hours looking at and cannot fix. I can get data from my db no problem with this code, but inserting or updating gives me these errors: *** Assertion failure in +[Functions db_insert_answer:question_type:score:], /Volumes/Xcode/Kanji/Classes/Functions.m:129 *** Terminating app due to un...

Can Core Data be used for objects with variable schemas?

I'm implementing a new iPhone app and am relatively new to Cocoa development overall. I am at the stage of choosing how the persistence layer of this app will work, and it looks like I'm basically choosing between Core Data and sqlite3. The persisted models in this app are intended to have a schema that is loaded at runtime (from some ...

Insert data in an object to a database.

I am facing the following design/implementation dilemma. I have a class Customer which is below with getters and setters. I would like to insert the value of the Customer into a "Customer" table of a database. But Customer has an address which is of type "Address". How do I go about inserting this field into the database?(I am using sqli...

uitableview not showing data

i followed the tutorial -> http://icodeblog.com/2008/09/02/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-2/ but the thing is my uitableview isnt showing anything from database!! i did an nslog and able to query the data..so what could be the possible error? i went through line by line with the source..but still can...

Unable to access tables created with sqlite3 from a program using the C API

I generate an sqlite3 database file (call it db.sl3; invoked interactively as $ sqlite3 db.sl3 from a shell) from within the sqlite3 commandline program, for instance create table people ( id integer, firstname varchar(20), lastname varchar(20), phonenumber char(10) ); ins...

how to insert value from one table to other table in sqlite3 database.

hi I am new in iphone i am developing a application with data base i am create a database and have to table we want to insert one table value to other. I am not understand how do this. if any body know help me with coding. ...

Memory usage with Django + SQLite3

I've got a very large SQLite table with over 500,000 rows with about 15 columns (mostly floats). I'm wanting to transfer data from the SQLite DB to a Django app (which could be backed by many RDBMs, but Postgres in my case). Everything works OK, but as the iteration continues, memory usage jumps by 2-3 meg a second for the Python process...

insert statement using sqlite3 for iphone

I wan to insert "title" and "description" into database using the following code but i am having problem in displaying the "title" into uitableview..instead of "title" it display the "description"...what could be the reason??am i inserting into the wrong column?i am sure i called the correct object. -this is how i create my table... CR...

sqlite3 delete does not delete everything?

Whats going on here? I would expect the following delete to delete everything from the table. Is there a fundamental mis-understanding of how sqlite3 behaves on my part? sqlite> .schema CREATE TABLE ip_domain_table (ip_domain TEXT, answer TEXT, ttl INTEGER, PRIMARY KEY(ip_domain, answer, ttl)); sqlite> select count(*) from ip_domain_t...