sqlite

SQLite3 - Cannot Open Database

I have the following code: #include <iostream> #include <string> #include "sqlite3.h" int main() { sqlite3* db; int rc = sqlite3_open("testing.db", &db); std::cout << rc << std::endl; std::cout << sqlite3_errmsg(db); std::cin >> rc; } When I run it, the program outputs "21" and "library routine called out of sequ...

SQLite with MFC

Hello, I want to use SQLite within my MFC application. for that, i'll create an object whose job is to interact directly with the DB(SQLite) to insulate the rest of the app from the DB code. can anyone point me to a good tutorial ? i'll need operations such as (create,delete,insert,update,createdb,dropdb and so on...) Thanks. ...

Updating the db 6000 times will take few minutes ?

I am writing a test program with Ruby and ActiveRecord, and it reads a document which is like 6000 words long. And then I just tally up the words by recordWord = Word.find_by_s(word); if (recordWord.nil?) recordWord = Word.new recordWord.s = word end if recordWord.count.nil? recordWord.count = 1 else recordWord.count += 1 end r...

Subquery in SQLite query not working

I am using the nested set model to store a large hierarchy of data in a local SQLite database on an iPhone. I read the MySQL tech article from their web site on how to do this, but one of the queries they suggest (and that I need) doesn't appear to work with SQLite and I'm not sure how to get around it. SELECT node.name, (COUNT(parent.n...

Store boolean value in SQLite

Hi, What is the type for a BOOL value in SQLite? I want to store in my table TRUE/FALSE values. I could create a column of INTEGER and store in it values 0 or 1, but it won't be the best way to implement BOOL type. Is there a way? Thanks. ...

sqlite3_enable_shared_cache and sqlite_backup_init slowing execution on iPhone

I have some relatively complex sqlite queries running in my iPhone app, and some are taking way too much time (upwards of 15 seconds). There are only 430 or so records in the database. One thing I've noticed is that opening a new database connection (which I only do once) and stepping through query results (with sqlite3_step()) causes sq...

SQLite - query involving 2 tables

Hi, I want to choose a row from a certain table and order the results basing on another table. Here are my tables: lang1_words: word_id - word statuses: word_id - status In each table word_id corresponds to a value in another table. Here is my query: SELECT statuses.word_id FROM statuses, lang1_words WHERE statuses.status >= 0 OR...

Sqlite insert into with unique names, getting id

I have a list of strings to insert into a db. They MUST be unique. When i insert i would like their ID (to use as a foreign key in another table) so i use last_insert_rowid. I get 2 problems. If i use replace, their id (INTEGER PRIMARY KEY) updates which breaks my db (entries point to nonexistent IDs) If i use ignore, rowid is not upda...

problem with sqlite write access for django-apache-wsgi app

an idea why? the debug screen says that django does not have write access to the db ...

FluentNhibernate and SQLite

Hi, I can't get SQLite Driver working in my sessionfactory. I downloaded SQLite 1.0.48 from http://sqlite.phxsoftware.com/ I have added the references to System.Data.SQLite in my Tests project. public static IPersistenceConfigurer GetSqlLiteConfigurer() { try { return SQLiteConfiguratio...

sqlite in vb.net, can't find table even though it exists

I'm using the following code (System.Data.SQLite within VB.net): Dim SQLconnect As New SQLite.SQLiteConnection() Dim SQLcommand As SQLiteCommand SQLconnect.ConnectionString = "Data Source=vault.db;" SQLconnect.Open() SQLcommand = SQLconnect.CreateCommand SQLcommand.CommandText = "INSERT IN...

SQLite for blackberry

Hi , Is sqlite available for blackberry?.Is any other option available other than that .... ...

ORDER BY with bool > date > null in SQLite

I have a loooooooooooong SELECT ending with a ORDER BY that can include the following values : checked (1 or 0) date (YYYY-MM-DD) time (HH:MM:SS) I'd like to order the result of the query the following way : |__checked = 0 | |__ date ASC | |__ time ASC | |__ date && time are null |__checked = 1 ...

iphone FMDB can't find table

- init { if(![super init]) return nil; //the database is stored in the application bundle. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingFormat:@"/base.sql...

SQLITE: how to remove an unamed primary key

I have a sqlite table that was originally created with: PRIMARY KEY (`column`); I now need to remove that primary key and create a new one. Creating a new one is easy, but removing the original seems to be the hard part. If I do .indices tablename I don't get the primary key. Some programs show the primary key as Indexes: 1...

Temporary in-memory database in SQLite

Is it possible somehow to create in-memory database in SQLite and then destroy it just by some query? I need to do this for unit testing my db layer. So far I've only worked by creating normal SQLite db file and delete if after all tests, but doing it all in memory would be much better. So is it possible to instanciate database only i...

Delphi components to use with SQlite

What components can I use to use SQlite database with delphi 6 Thanks ...

persons where the children are grouped for their parent

I have an SQLite database with a simple table of Persons. Each row represents a person and has four columns: the primary key (id), one for the name, one for the age and one for the parent (points to the primkey id, is NULL if the person has no parent). Now, I just want to list all those persons sorted on age and have the children group...

Delphi 6 / Zeos / SQlite

Hello, I am writing a program that uses master / detail I am new to Zeos and SQlite I already have the conection, two tables, etc. I have an autoincrement primary key field on the master table I want to update. What should I do to automatically retrieve the primary key field value (and the record pointer stays on the record I have just...

iPhone & SQLite: Some database changes are not persisting after app close and relaunch.

Hi there, I've got an iPhone app I'm developing and when the app launches I open an SQLite database connection, and I close it when the application terminates. The database is correctly in the applications documents folder. During the lifetime of the app I run several INSERT and UPDATE statements. However, for some reason my UPDATE sta...