sqlite

sqlite3_open - problems checking if a file is a sqlite3 database

Hey, I'm working with sqlite3 for the first time, and cannot get it to properly check a file before it opens it. So far, sqlite always returns OK on any file. Also, the file name is a variable returned from the GTK file chooser. It returns an absolute path, I'm guessing this is not a problem. Thanks for any help. This is a snippet of...

Full Text Searching in Apple's Core Data Framework

I would like to implement a full text search in an iPhone application. I have data stored in an sqlite database that I access via the Core Data framework. Just using predicates and ORing a bunch of "contains[cd]" phrases for every search word and column does not work well at all. What have you done that seems to work well? ...

Howto: Insert rows into Sqlite quickly on the iphone

Whats going to be the fastest way for me to insert 26,000 rows into a new sqlite3 table on the iphone? My naive implementation was to create a file foo.sql looking like this: BEGIN TRANSACTION; CREATE TABLE user_db.places ( place_id integer primary key, -- cornell id less the leading L lat real not null, lng real not null...

Where does A SQLite Database go for a winforms application?

I am trying to use SQLite for a winforms application, what I can't figure out is where to put the datafile in the code, and what my connection string should be. Right now i have added an "App_Code" directory to my may project, and placed my datafile in that directory. I am getting an error that SQLite cannot find the table that does ex...

Can't get PHP session save handler sqlite working

I have set up a little server on an old XP Pro box, with php 5.3.1. In order to use it as a test box to mirror our hosted site, I need to get sqlite sessions working. While sqlite is definitely there in phpinfo(), I can't seem to get php.ini to use it as a save handler: Registered save handlers - files user In php.ini, I've got s...

Foreign Key Useful in SQLite?

I have two tables 'Elements' and 'Lists' Lists has a primary key and a list name. Elements has data pertaining to an individual entry in the list. Elements needs a column that holds which list the element is in. I've read about SQL's foreign key constraint and figure that is the best way to link the tables, but I'm using SQLite which d...

How do I DROP a constraint from a sqlite (3.6.21) table?

I have the following table: CREATE TABLE child( id INTEGER PRIMARY KEY, parent_id INTEGER CONSTRAINT parent_id REFERENCES parent(id), description TEXT); How do I drop the constraint? sqlite> ... ? ...

How do I add a foreign key to an existing sqlite (3.6.21) table?

I have the following table: CREATE TABLE child( id INTEGER PRIMARY KEY, parent_id INTEGER, description TEXT); How do I add a foreign key constraint on parent_id? Assume foreign keys are enabled. Most examples assume you're creating the table - I'd like to add the constraint to an existing one. ...

SQLite Flow Constructs in SQL?

With MSSQL, I can mix in case, if...then, and while constructs in my SQL code. Is anything similar available for SQLite? I have not seen anything on "mixing procedurally" with SQLite, anywhere. Thanks. ...

How to export data from SQLite in PDF format within the iPhone application?

I'm trying to write an iPhone application. In my program, I wanna export the data from SQLite database with the PDF format within my program. And I wanna attach it to the email sending part. Thanks. ...

Does SQLite support replication?

In an application which embeds SQLite3 and uses an in-memory database, is it possible to replicate the database between two running instances of the application? I could do this by hand with a homebrew protocol duplicating all my DB accesses, but it seems like something that should be done inside the DB layer. ...

SQLite3 open file problems

I'm using GTK+ and SQLite as a front end for a small database program, and I cannot get SQLite to properly detect file type on open. Not matter what is opened, it returns SQLITE_OK. I tried sqlite3_open and sqlite3_open_v2, the problem still persists. The output is always the same, regardless of what filetype is opened: /home/shawn/P...

SQLITE update fails with error code 1 (SQLITE_ERROR)

Hey sqliters, I am having a strange or maybe not so strange problem with my sqlite db. I have a field of "Text" type and it worked like a charm with any English texts for ages. The text in the field used to come from an MFC CEdit. Now I switched to CRichEditCtrl to support formatting and UNICODE texts. The CRichEditCtrl dumps the for...

Connecting to MySQL with Tcl

Hello: I had a question about where a MySql database has to sit for a Tcl application to read it. Currently, I have a Tcl application that reads off of a sqlite database. For the application to find the database, the Sqlite Db must be located in the same folder as the Tcl application. I am planning on upgrading the Sqlite Database t...

create tables/rows in ram using sqlite?

I remember once i had temporary data used on a webpage. I used php and mysql to create a table that stored visitors ips and the port they requested. I didnt care how long they lasted because after 10mins or an hour the data would no longer be relevant. I cant remember how i did it but using sqlite instead... How do i create a table for ...

Creating new SQLite DBs with PDO

I want to provide a setup feature in my next project and I'm wondering if it's possible to create a SQLite 3 database from scratch with PDO or I'm just stuck at connecting to existing databases via DSN? If it isn't possible with PDO is there any way to create a new DB via PHP? ...

Use sqlite database from Android app resources

Hi everyone! I've started Android programming recently so bear with me :) I develop an app which has all of its content stored in database.sql file. I've implemented a subclass of SQLiteOpenHelper and added database.sql to my project assets. public class DBHelper extends SQLiteOpenHelper { public DBHelper (Context ctx) { super(ctx, ...

How do i escape sql and get the text instead of put it in a query?

I want to generate querys but i wont be executing. Just showing the text query after everything has been escape. I cant figure out how to get the escape value. I searched the object browser for escape hoping to find a function but i didnt. I then had a longshot idea that this (string)new SQLiteParameter("@dummy", text).Value may work but...

SQLite Out of Memory when preparing insert statement

I have a problem with my app it opens this database and selects rows from it ok, Then when I want to add new rows using the following code and I always get the following problem at the execution of the prepare_V2. *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error while creating add statem...

Sqlite group_concat ordering

In Sqlite I can use group_concat to do: 1...A 1...B 1...C 2...A 2...B 2...C 1...C,B,A 2...C,B,A but the order of the concatenation is random - according to docs. I need to sort the output of group_concat to be 1...A,B,C 2...A,B,C How can I do this? Thank you ...