I want to have compatible SQL for both Oracle database and Microsoft SQL server.
I want a compatible SQL expression that will return true for not null and not empty strings.
If I use:
column <> ''
it will work on Microsoft SQL server but not on Oracle database (as '' is null for Oracle)
If I use:
len(column) > 0
it will work on Microsoft SQL server but not on Oracle database (since it uses length() )
''isnullin Oracle, I still cannot see whycolumn <> ''will not work. Ifcolumnhas a (non-empty) value, the condition will returntrue, which is what you want. What am I missing? Moreover, ifcolumnis empty, which means 'is null' for Oracle, the condition will return 'false' or 'unknown', the latter being the same as the former in this case. So, again, why can it not be used in Oracle?column <> ''will be evaluated ascolumn <> NULLso'some text' <> ''will be evaluated as'some text' <> NULL=NULL(orUnknownas you call it). I guess one would like that to yield True and not Unknown.columnand missed the''as the right part of<>. Yes, it's all clear now, thank you! I mean, although you only think so, that's very much like what happens actually.