fmdb

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...

Has anyone tried any of the SQLite3 wrapper APIs for easier database functionality on the iPhone?

Coming from a non-SQL background, I've been having a hard time absorbing SQLite3 for the past few days. Has anyone had any good results using any of the SQLite3 wrapper APIs out there? Do they work reliably? Which is best? I am also hearing buzz about Core Data coming to the iPhone. Not sure whether that info is trustworthy or not but ma...

FMDB transaction

Hi ! I use FMDB to wrap SQLite in my app. I haven't found any docs about the use of methods begin, beginUpdates, commit, finalize, etc. I face some problems in my apps which i think are caused by the way i use transactions. Here is what i tried : [FMDB beginUpdates] - My insert statement - [FMDB commit] [FMDB finalize] it crashes wi...

Iphone Unit Test : with SQL

Hi, I'm trying to do some Unit Testing on method that includes SQL call wrapped by FMDB. I get a lot of linker errors when i try to build the project such as these ones : "_sqlite3_step", referenced from: -[FMResultSet next] in FMResultSet.o -[FMDatabase executeUpdate:arguments:] in FMDatabase.o "_sqlite3_column_name", ...

Is there a tutorial about how to use FMDB, the sqlite3 wrapper class?

The FMDB page just offers the cvs checkout. Maybe someone out there wrote a good tutorial on how to use FMDB with sqlite3 on the iphone? ...

SQLite - running on Device

FMDB runs great in the simulator, but I get the following errors when I try to run it on the device. "_sqlite3_step", referenced from: -[FMResultSet next] in FMResultSet.o -[FMDatabase executeUpdate:arguments:] in FMDatabase.o "_sqlite3_column_name", referenced from: -[FMResultSet setupColumnNames] in FMResultSet.o ...

How to delete a row in a sqlite database table ?

I am using fmdb for managing my database. I could not find any example for deleting a row from a table in fmdb. I tried NSString *sqlStat=@"DELETE from tableName WHERE id=3"; FMResultSet *rs = [database executeQuery:sqlStat]; but its not working because when I checked the total number of entries in table, I am getting the sam...

How do I import a class into an iPhone project?

I'm sure this is very easy but I'm trying to get the fmdb sqlite wrapper to work in an iPhone project. I've grabbed the files via SVN, and there are 'h' and 'm' files inside an 'src' folder. I'd assumed that if I right-click the Classes folder and select Add > Existing Files... that would work. But when I try to compile I get an error...

EXC_BAD_ACCESS in SQLite on Mac OS

I'm pulling and pushing data from an sqlite database. I use the FMDatabase cocoa wrapper. I'm pulling and pushing data from multiple threads, but I made sure that more then one transactions never happen at the same time. I get EXC_BAD_ACCESS after a few hundred call at the database but never at the same time. It's also not memory rela...

EXC_BAD_ACCESS when using SQLite (FMDB) and threads on iOS 4.0

Hello, I am using FMDB to deal with my database which works fine. The app uses a background thread which is doing some work and needs to access the database. At the same time the main thread needs to run some quieries on the same database. FMDB itself has a little locking system, however, I added another to my classes. Every query is o...

Problem in inserting data in SQLite?

Hi i am using FMDB to retrieve data from SQLITE database. db = [[FMDatabase alloc] initWithPath:path]; [db open]; FMResultSet *fResult= [db executeQuery:@"SELECT * FROM Users"]; aUsers = [[NSMutableArray alloc] init]; while([fResult next]) { userData = [fResult stringForColumn:@"Name"]; lblUsers.text=[lblUsers.text...

iPhone + sqlite3 + fmdb, What code do i need to put data into a UiTableView datasource?

If I was adding data from an array to the UITableView datasource array I'd use this, in viewDidLoad. NSMutableArray *array = [[NSArray alloc] initWithObjects:@"Head First Design Patterns", @"Head First HTML & CSS", @"Head First iPhone", nil]; self.transactionsArray = array; [array release]; And this in cellForRowAtIndexPath NSInteger...

FMDB SQLite question: row count of a query?

Hiyas does anyone know how to return the count of a query when using FMDB? If I executeQuery @"select count(*) from sometable were..." I get an empty FMResultSet back. How can I get the row count of the query? Do I need to do a query like "select * from sometable where.." and iterate through the result set? Or can I use useCount or what...

FMDB open database

Hi, I'm trying to open a database that I have in my project inside Resources. The problem is that it seems that its impossible to find the database file! I tried with the complete path, and it works, but this is not a good solution. I would like to now how to open it! I'm using this code: db = [FMDatabase databaseWithPath:@"bbdd.sql"]...

FMDB query is not taking any effect on the DB

I am using FMDB in my app to do some updates in my DB. Problem is when I update my table with executeUpdate function, it update my table BUT if I copy the same .sqlite file from project to at another place in my drive and try to query using terminal, it shows that database is not updated, why it is so? ...

deleting row in SQLite 3

In UITableView, I want to delete a row and remove that row on database, but my query of sqlite don't works. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { UIAlertView *view; ...