Search code examples
iossqlitefmdb

Ifnull using FMDB


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.


Solution

  • 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