Page 1 of 1

no such function: if in SQLite

Posted: Fri 18 May 2012 18:05
by mohsen24000
hi dears.
why does not work 'IF' keyword in SQLite Queries on TUniQuery!?

Re: no such function: if in SQLite

Posted: Mon 21 May 2012 07:20
by ZEuS
Hello.

There is no IF-THEN-ELSE implementation in SQLite.
You should use the CASE expression instead of IF.
You can find more information about the CASE expression in the official SQLite documentation here: http://www.sqlite.org/lang_expr.html#case

Re: no such function: if in SQLite

Posted: Thu 24 May 2012 15:06
by mohsen24000
thanx!
it is worked...
but in some applications such as SQLite2009 Pro, in query statements "IF" keyword does work!

Re: no such function: if in SQLite

Posted: Fri 25 May 2012 08:52
by ZEuS
The point is that SQLite2009 Pro uses a specially built SQLite client library with many additional features provided. The official version of the client library that is available on the SQLite site, doesn't provide such functionality.