Robert Duff <[EMAIL PROTECTED]> wrote:

> I had a problem with inserting bad unicode characters into my database. 
> ...
> Returned by "SELECT locationsFK,variable,logindex, CASE units WHEN units 
> ISNULL THEN '#!#!#!#!#!#!#!#!#!#!' WHEN units = '??F' THEN 
> '####################' WHEN units != '??F' THEN '!!!!!!!!!!!!!!!' ELSE 
> 'WHY DOES ONLY THE ELSE WORK???????' END FROM data LIMIT 10;"
> "1", "NVE_AI_2Boiler2_SupplnvoValu", "5", "WHY DOES ONLY THE ELSE 
> WORK???????",
> ...

I don't know if there's any other problem, but it looks like
you don't understand how case expressions work. There are
two forms, and you're confusing them. If you remove the
first instance of 'units' in your query, it may work as you
were expecting.

The SQLite documentation <http://sqlite.org/lang_expr.html>
gives the correct grammar but doesn't explain the semantics.
You can probably find examples of the two variants in one of
the several introductions to SQL on the web.

Regards

Reply via email to