sqlite3

sqlite works on simulator, but not on device

Hi guys I have a question, I can't get my sqlite database to work/open on an ipad device. Everything works fine on the simulator but not a real device. I put MODE to NO when i want to test on a device but it fails to load. sqlite3 *database; if (MODE) { //Simulator result = sqlite3_open("/Users/userID/Myapp/VRdb.sqlite", &datab...

Python/Sqlite3 - is there a way to programmatically set .nullvalue?

Currently, Python is storing the string "None" for nulls returned by sqlite3. I read that you can change the default value for nulls in sqlite3 at the command line, but can you set this within the Python code? I'd like all of my blank results to look the same without having to loop through and check each value. So I want any nulls ret...

SQLite suitable for concurrent reading?

Will an SQLite database perform well to around 50 reads/second without locking? I'm trying to decide whether it'd be feasible for use on a PHP website that won't get 'written' to very often - it'll be mostly reads of the same data from a small handful of tables Thanks ...

Sqlite equivalent to MySQL's DESCRIBE [table]?

I'm just getting started learning Sqlite. It would be nice to be able to see the details for a table, like MySQL's DESCRIBE [table]. PRAGMA table_info [table] isn't good enough, as it only has basic information (for example, it doesn't show if a column is a field of some sort or not). Does Sqlite have a way to do this? ...

GUI tool for sqlite3?

Im using the bundled sqlite3 version for rails and i wonder if there is an equivalent to phpmyadmin? How else am i going to see what is in the database? Thanks ...

How can I upgrade the sqlite3 package in Python 2.6?

I was using Python 2.6.5 to build my application, which came with sqlite3 3.5.9. Apparently though, as I found out in another question of mine, foreign key support wasn't introduced in sqlite3 until version 3.6.19. However, Python 2.7 comes with sqlite3 3.6.21, so this work -- I decided I wanted to use foreign keys in my application, so ...

Load the table view again after returning form another view

hey, when my application loads i have a table view which shows data present in my database. On clicking the add button it goes to another view and the data inserted is updated in the database. Now how do i load this updated data when i return from this view to the first view. Which method do i need to call? ViewDidAppear? or ViewWillAp...

ContextSwitchDeadlock Exception while inserting data to sqlite database

I have a Sqlite Database where I am enumerating my directory structure and inserting records into 5 different tables. Total Files + Folders count = 4000. Also there is nested loops. Can say all loops runs for 4000 times cummulative to insert the records. Earlier it was built with Sql Server where it was running absolutely fine. It was t...

Android column '_id' does not exist?

I'm having trouble with something that works in the Notepad example. Here's the code from the NotepadCodeLab/Notepadv1Solution: String[] from = new String[] { NotesDbAdapter.KEY_TITLE }; int[] to = new int[] { R.id.text1 }; SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to); This code seems to w...

sqlite database

1 while running, data is not showing in views after Inserting/Updating in sqlite3 databse.How do i refresh database?? 2 in xcode where do i close my database?? ...

SQLite 3 Busy Exception in Rails 2.3.8

SQLite3::BusyException: database is locked: CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email") I get the above error when I try to migrate a migration (written below) class AddIndexEmailUniquenessToUsers < ActiveRecord::Migration def self.up add_index :users,:email,:unique => true end def self.down remove_...

SQL inner join two tables with the same column names

Hello I have two tables with a variable amount of columns. (I don't know how many columns or what there names will be) for example Table A and Table B. TableA: ID | B_ID | {variable} TableB ID | {variable} Query: SELECT TableA.*, TableB.* FROM TableA INNER JOIN TableB ON TableA.B_ID= TableB.id; When TableA and TableB bot...

SQLite copy database destroyed original, Why?

Hello I got this code snippet to copy a file database to a memory database. it works but it destroys the original file database. (By destroys I mean sets the file size to zero) /** * Exec an sql statement in values[0] against * the database in pData. */ int process_ddl_row(void * pData, int nColumns, char **values, char **columns)...

Loop and strings in Ruby/SQLite3

Hello, So I need to run a loop in Ruby to pass some strings into SQLite. Basically I have a table that looks like this: pID Data 1649,1650,1651|Some data 1643,3|some more data 23,4,5,6,7|More data Now in my SQLite queries, I will sometimes need to pass all the pIDs for a given line through as one whole string, which I ca...

SQLite VFS implementation guild lines with FOpen*

Hello I am about to implement a custom VFS (virtual file system) for a Netburner embedded device (non windows) using FOpen, FRead, FWrite, FSeek, and FClose. I was surprised that i could not find a FOpen* version of the VFS available. It would make it a lot more portable to embedded devices. I found some information on creating the V...

CakePHP - $hasAndBelongsToMany and $hasMany relationships between tables that reside on separate databases and have different querying languages?

I have quite the complex problem to tell you about Stackoverflow, you see I have three tables that I need to define associations between for an application. These tables are: engineers, tickets, and testcases. I need to have a $hasMany relationship between engineers and tickets, and a hasAndBelongsToMany relationship between testcases an...

unable to open database

I am using below code for inserting data in the database. and i am inserting aprox 15000 records but after 245 records it throws the error "Unable to open database" +(void)addGeoRegions:(const char *)query geoId:(int)geoId geoFatherId:(int)geoFatherId geoName:(NSString *)geoName geoTypeRegionId:(NSString *)geoTypeRegionId geoZo...

Query select a bulk of IDs from a table - SQL

I have a table which holds ~1M rows. My application has a list of ~100K IDs which belong to that table (the list being generated by the application layer). Is there a common-method of how to query all of these IDs? ~100K Select queries? A temporary table which I insert the ~100K IDs to, and Select query via join the required table? Tha...

Getting MDB2 to work with sqlite3 via pdo

I am using MDB2_Driver_pdoSqlite to access a sqlite3 database with PEAR. I am able to connect to the database and display a list of tables with listTables(), but when I try to run the mdb2 function tableInfo() I get an error. MDB2 Error: not found [Error message: primary is not an existing table constraint] I am running the following sys...

Calculate the number of direct children in a hierarchy

I have a simple hierarchy of categories in an SQLite3 database, each row storing a parent ID or NULL as appropriate. I would like to find out whether a particular category is a leaf, essentially by determining, for each row, whether it has a parent ID defined. Or rather, determining a count of child rows for each row. Table definiti...