sqlite

Load SQLite database from remote SQL Server?

I'm using SQLite ADO.NET in my project so that I can unit test using an in-memory database. I want a copy of my real database but it is across the server. From what I've read, it looks like I have to specify ":memory" for the data source for the SQLite connection string. My problem is that I don't even know if it's possible to load a ...

What are the sqlite equivalents of MySQL's INTERVAL and UTC_TIMESTAMP?

What are the sqlite equivalents of INTERVAL and UTC_TIMESTAMP> For example, imagine you were "porting" the following SQL from MySQL to sqlite: SELECT mumble FROM blah WHERE blah.heart_beat_time > utc_timestamp() - INTERVAL 600 SECOND; ...

Best DBMS for iphone

What is the best DBMS to use in iphone when there is huge data that is to be sorted and searched often. I though to use sqlite but it has many complexities. as when a table is created once it doesn't allow to change its structure, No way to define relationship etc. Can any one guide me wat way to follow Regards, ...

How do I specify a Primary Key in Sqlite

How to define your specified attribute like StudentId in student table as Primary key in sqlite ...

Pros and cons of various online code sharing sites

BACKGROUND: In order to learn C#, I have spent the last year converting the source code of SQLite from C to C#. As of the current version 3.6.16, it is now ready to release in the wild. I don't want to self-host CVS or some other repository, so I am trying to decide where to post the code. My goals are simple. I just want to allow...

SQLite: prevent duplicates

Hi, I would like to create a table to store device settings. The table has three rows: id, parameter_name and parameter_value. The table was created by executing the following query statement: DATABASE_CREATE = "create table DATABASE_TABLE (KEY_ID INTEGER PRIMARY KEY AUTOINCREMENT, KEY_NAME INTEGER not null, VALUE TEXT not null); an...

Android: Where are database files stored?

Hi, I created a SQLite database on Android device. The program can read/write to database so the database file has obviously been created. The SQLiteDatabase.mPath is set to db.mPath = "/data/data/dev.client.android/databases/clientDB.db" but when I browse the directories on the device I can't locate the file clientDB.db. I looked in...

Sqlite binding within string literal

Using sqlite3, if my query is SELECT * FROM table WHERE title LIKE '%x%' It will match strings that contain x. I want to make x a bindable parameter, like: SELECT * FROM table WHERE title LIKE '%x?%' However, this does not work since the '' form a string literal. Is there some way of escaping the ? within the literal? I understand th...

iphone SQLite Select Query doesn't work

Hi, In the code below, I am connecting to an SQLite Database, the SELECT query didn't work. I hope you can help me. Thanks if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { // Setup the SQL Statement and compile it for faster access const char *sqlStatement = "select name,score from game Where name='interclock'"...

Android: Retrieving data from the database issue

Hi, I created the following method for retrieving stored settings from the database: public String getEntry(long rowIndex){ String value = ""; Cursor c = db.query(DATABASE_TABLE, new String[] {KEY_NAME, VALUE}, KEY_NAME + "=" + rowIndex, null, null, null, null); int columnIndex = c.getColumnIndex(VALUE); int rowsCount = c.getCo...

iphone - SQLite records on table dont coming ?

hello, i have a table. and 3 record. and i have that code; -(void) readScoreFromDatabase { sqlite3 *database; scores = [[NSMutableArray alloc] init]; if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { const char *sqlStatement = "select name,score from game"; sqlite3_stmt *compiledStatement; if(sqlite3_prepa...

Serialisation and Databasetechnics to locate objects

Hello there, I was wondering if there is a (c++ or D) serialisation library that also provides technics to locate a certain object (which was saved to disk) based to certain criterias like a certain attribute combination. I know about sqlite and mySQL and so own, but I search for an alternative. Because those databases are not bound to...

Eager loading vs. many queries with PHP, SQLite

I have an application that has an n+1 query problem, but when I implemented a way to load the data eagerly, I found absolutely no performance gain. I do use an identity map, so objects are only created once. Here's a benchmark of ~3000 objects. first query + first object creation: 0.00636100769043 sec. memory usage: 190008 bytes itera...

Add a DbProviderFactory without an App.Config

I am using DbProviderFactories in my data layer (based on Entity Framework) and am using SQLite for my database, but I don't have to have a App.Config to have the following code: <configuration> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite"/> <add name="SQLite Data Provider" invariant="Syst...

SQLite Queries

I want to select some records from a table depending on multiple limitations like i want to get records which lies in a range < OR > how can i write such query in SQLite.....? ...

Foreign key definition in sqlite

Is there any way to define relationship among tables and give foreign keys among them while using sqlite in Objective c ...

Android database: IllegalStateException problem

Hi, I created the SQLite database the following way: private static final String DATABASE_CREATE = "create table " + DATABASE_TABLE_SETTINGS + " (" + KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_NAME + " INTEGER UNIQUE not null, " + VALUE + " TEXT not null);" + "create table " + DATABASE_TABLE_RECORDINGS + " (" + KEY_ID + " ...

SQLite autoincrement regex

I am taking create statement queries from SQLite like this: CREATE TABLE [users] ([id] INTEGER PRIMARY KEY AUTOINCREMENT, [username] VARCHAR, [password] VARCHAR, [default_project] VARCHAR) created by using SELECT sql FROM sqlite_master WHERE type = 'table' AND name = :table and determining the autoincrement field with a regular ex...

Unnest an SQL statement

I have this working SQL statement: select oriseqs.newID from oriseqs WHERE oriseqs.singlets=1 AND oriseqs.newID not in (select newID from cleanreport WHERE trash!="") My question is how to avoid doing one select inside another in this particular case. I mean to rewrite the select statement in a way that there is no nested select. He...

Querying and working with Cursors in SQLlite on Android

Hi Not sure if I'm the only one who feels this... I find working with the sqlite api in android a complete pain in the butt and pretty soul destroying. Has anyone got any tips/helpers to make my life easier? Here's an example of what I'm talking about. //create code db.execSQL("CREATE TABLE " + CUSTOMER_TABLE_NAME + " (" ...