Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread NULL between DBISAM and EDB.
Mon, May 28 2012 5:52 AMPermanent Link

Abdulaziz Al-Jasser

Hi,

Again this could be a basic question, but I have the following simple SQL clause:

SELECT * FROM TB_Items WHERE ItemBrandName <> NULL

It works in DBISAM3 but in EDB it raises and error, so I tried:

SELECT * FROM TB_Items WHERE ItemBrandName <> ''

It works but it does not give the same result.  How to replace NULL in EDB to have the same results?
Regards,
Abdulaziz Jasser
Mon, May 28 2012 8:48 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Abdulaziz


Two things:

1. First and most important in ElevateDB NULL and an empty string ('') are no longer the same. This, unfortunately is the SQL standard. The approved SQL way of testing for a NULL is "field IS NULL" or "field IS NOT NULL" or even "NOT field IS NULL"

2. The is an engine switch (TEDBEngine.StandardNullBehavior) which allows this to be changed. Check it out in the pdf manual.

Roy Lambert
Mon, May 28 2012 11:51 AMPermanent Link

Uli Becker

Abdulaziz,

> It works but it does not give the same result.  How to replace NULL in EDB to have the same results?

In addition to Roy's answer: if you want to select NULL- and Empty
values, "coalesce" helps:

SELECT * FROM TB_Items WHERE coalesce(ItemBrandName,'') <> '';

Regards Uli
Image