0

I've just switched my iOS app from using plain SQLite to using FMBD. It's going great and I am a big fan. The only problem I'm having is that I have used the ifnull function in a number of my old SQLite calls, and it doesn't seem to work with FMDB. I get a message saying

Warning: I could not find the column named 'columnName'

I've tried a number of different ways of calling the statement, but I could be missing something simple.

Is there any way around this?

Any help would be much appreciated.

Cape Code
  • 3,584
  • 3
  • 24
  • 45
shmozzle
  • 15
  • 5
  • `IFNULL` appears to work fine with FMDB. You might want to show us a simplified code that manifests the problem. Generally you get that error if you use one of the `FMResultSet` methods with an invalid column name, but to generate the error you reported, you would have had to literally have something like `[rs stringForColumn:@"columnName"]` or `rs[@"columnName"]` (where you had `@"columnName"` rather than the actual column name). – Rob Aug 26 '14 at 22:28

1 Answers1

0

I use IFNULL with FMDB and it works perfect

Trivial, but have you tried:

IFNULL(columnName, "I am sad, because I am NULL") as columnName
Quver
  • 1,408
  • 14
  • 21