1

I'm using Javascript for a Phonegap App and SQLite in order to manage my database.

This is simple, I'm trying to make this query:

SELECT IFNULL(name, 'Not Specified') FROM person

When I run it on SQLite Manager it works just fine, returns me "Not specified" when is null, and the name of the person when it's not. Nothing wrong here.

But, in the real app, that very same query returns undefined. If I change the query to

SELECT name FROM person

it works, but when I add the IFNULL function, it just starts returning undefined for every row.

Any hint about this?

Agustín
  • 1,546
  • 7
  • 22
  • 41
  • That sounds odd. [`IFNULL` is a documented feature for SQLite](http://www.sqlite.org/lang_corefunc.html#ifnull), though it's not clear from version history when it was added. Have you tried using [`COALESCE`](http://www.sqlite.org/lang_corefunc.html#coalesce)? Are you sure there are no error codes/messages that you're missing? – rutter Feb 07 '14 at 21:08
  • I tried both of them. Yeah I'm sure cause its a prove of concept test, clear of any other code, it's weird – Agustín Feb 07 '14 at 21:09

0 Answers0