sqlite

How to directly store SQLite data in XCode?

Hi guys: Searched on here and got some vague answers, so I thought i'd rephrase the problem to get some clearer answers- Right now I have an SQL Lite db that reads/parses information from a pre-formatted .txt file. When I open the app, there is a slight 'lag' as the iDevice parses the info, then gets fetched for the iDevice. I'm just wo...

NSArray vs. SQLite for Complex Queries on iPhone

Developing for iPhone, I have a collection of points that I need to make complex queries on. For example: "How many points have a y-coordinate of 10" and "Return all points with an X-coordinate between 3 and 5 and a y-coordinate of 7". Currently, I am just cycling through each element of an NSArray and checking to see if each element m...

Would an ORM have any way of determining that a SQLite column contains date-times or booleans?

I've been thinking about using SQLite for my next project, but I'm concerned that it seems to lack proper datetime and bit data types. If I use DbLinq (or some other ORM) to generate C# classes, will the data types of the properties be "dumbed down"? Will date-time data be placed in properties of type string or double? Will boolean data...

Help me choose between XML or SQL Lite on android

I have an android app that periodically, say once a week downloads content from a server in XML. The content is used by the app, different Acitivities use different parts of the content. My question is a design one, should I save the data in SQlite or just keep it as an XML file, which one would be faster to read? The app can only use...

Logging erros in SqlLite database from C# Windows Forms Application

I'm developing a win app in C# which communicates to a WCF Service. I want to log exceptions that are thrown on client to be logged in Sql Lite Database (Win app is using Sql Lite database for storing data locally). And then later it should be sent to the wcf service when required so that it can be useful for support/analysis/application...

Should we denormalize database to improve performance?

We have a requirement to store 500 measurements per second, coming from several devices. Each measurement consists of a timestamp, a quantity type, and several vector values. Right now there is 8 vector values per measurement, and we may consider this number to be constant for needs of our prototype project. We are using HNibernate. Test...

Special Characters from SQLite DB

Hi, I read from a sqlite db to my iphone app. Within the texts sometimes there are special characters like 'xf2' or 'xe0' as I can see in the debugger in the char* data type. When I try to transform the chars to an NSString Object by using initWithUTF8String, I get a nil back. How can I transform such special characters? Thanks for you...

HTML5: Can an SQlite database be specified in a manifest's Cache section?

I'd like to be able to specify an SQLite database as a resource in the CACHE section of a manifest file. This would allow the script on the page to use the database in offline mode. I cannot find anything in the HTML5 spec that says this cannot be done, but I haven't had any success in getting it working either. Is it possible? ...

Insert a record with a value partly from another table

I have two tables, Proteins and Species. Protein has Species.Id as foreign key constraint. When I insert the data, I know the name of the species that protein belongs to, but not the Id. So I do the following: PreparedStatement query = connection.prepareStatement( "SELECT Id FROM Species WHERE ShortName = ?"); query.setS...

Storing data locally and synchronizing it with data base on linux server

Hi all, I have developed a mac application, which is continuously interacting with database on linux server. As data is increasing it has become costlier affair in terms of time to fetch data from server. So I am planning to store required data locally, say on SQLite and find some mechanism through which I can synchronize it with databa...

SELECT subset from two tables and LEFT JOIN results

Hi all, I'm trying to write a bit of SQL for SQLITE that will take a subset from two tables (TableA and TableB) and then perform a LEFT JOIN. This is what I've tried, but this produces the wrong result: Select * from TableA Left Join TableB using(key) where TableA.key2 = "xxxx" AND TableB.key3 = "yyyy" This ignore cases where key2=...

Leak in managedObjectContext save:

Hi I have the following piece of code and when I use Instruments/Object Allocations, it tells me that there is a leak there (which goes down to sqlite3MemMalloc). Is there something that I should release? if (![managedObjectContext save:&error]) { NSLog(@"Error while saving."); } The save works well and doesn't trigger an error. ...

Time fields in Rails coming back blank

I have a simple Rails 3.b1 (Ruby 1.9.1) application running on Sqlite3. I have this table: create_table :time_tests do |t| t.time :time end And I see this behavior: irb(main):001:0> tt = TimeTest.new => #<TimeTest id: nil, time: nil> irb(main):002:0> tt.time = Time.zone.now => Mon, 03 May 2010 20:13:21 UTC +00:00 irb(main):003:0> t...

SQLite data-types

Hi there, When creating a table in SQLite3, I get confused when confronted with all the possible datatypes which imply similar contents, so could anyone tell me the difference between the following data-types? INT, INTEGER, SMALLINT, TINYINT DEC, DECIMAL LONGCHAR, LONGVARCHAR DATETIME, SMALLDATETIME Is there some documentation some...

DbMetal chokes on repeated foreign key references in SQLite - any ideas?

I've been struggling to get DbMetal to process my SQLite database. I finally isolated the problem. It won't allow a table to have two foreign key references to the same column. For example, a SQLite database with these two tables will fail: CREATE TABLE Person ( Id INTEGER PRIMARY KEY, Name TEXT NOT NULL ); CREATE TABLE Match ...

Embedded file system and sqlite

I'm working on an embedded project that has no file system, and our kludge of a database has ballooned in functionality. It's now so inefficient, we can't stand it any longer. I'm trying to figure out if there's built-in support for a flat file system in SQLite. I've dug around http://sqlite.org for a while now, but haven't found anyt...

sqlite database opens fine on the iPhone simulator, but not on the device

Why would this run fine on the iPhone simulator... but the database can't be opened on an iPhone device? sqlite3 *g_Db = nil; BOOL OpenDatabase(NSString *databaseName) { if(sqlite3_open([databaseName UTF8String], &g_Db) == SQLITE_OK) { NSLog(@"Opened db ok"); return(YES); } else { NSLog(@"Can...

Getting the primary key back from a SQL insert with SQLLite

Hi, I have a SQL table set that looks like this create table foo ( id int primary key asc, data datatype ); create table bar ( id int primary key asc, fk_foo int, foreign key(foo_int) references foo(id)); Now, I want to insert a record set. insert into table foo (data) values (stuff); But wait - to get Bar all patched up hunky...

Does the Quick Search Box search the database in Android? how?

i have an database with the values of latitude and longitude. i would need to search those values depends on the user input. does the quick search box can search only the database value with the type-to-search feature. Else i want to put a separate EditText and then do the the search process.. if QSB is possible then how to do that? i wa...

iPhone Database & Server Database - iPhone updates only modifcations

Hello ! Every one. I have some query. First of all let's have an iPhone application flow which a normal application has. ( Content based application ) Application launches & checks for the network availability If network is available - iPhone downloads the data using web services or APIs We can store these response ( web service res...