#1 2021-05-12 23:25:26

wxinix
Member
Registered: 2020-09-07
Posts: 121

What is the correct SQLWhere for "Not Equal" condition?

I tried <>, !=, but none of them seems to work?

LObjList := RetrieveList<MyObject>('Object_ID <> ?', [AObjectID])

Offline

#2 2021-05-13 06:43:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,350
Website

Re: What is the correct SQLWhere for "Not Equal" condition?

<> and != are just fine at SQL level
https://www.tutorialspoint.com/sqlite/s … rators.htm

Which DB engine are you using behind?
What is the error?
What is the SQL executed by the ORM?

The first reflex is to enable logs in your project, and check them.
Most of the time, you will find enough information to circumvent the problem.
(but please don't post the logs in here directly as stated by the forum rules)

Offline

#3 2021-05-13 12:37:50

wxinix
Member
Registered: 2020-09-07
Posts: 121

Re: What is the correct SQLWhere for "Not Equal" condition?

Thank you.  It is the mORMot static in memory db (object list).  I checked the manual it seems static in-mem db doesn't support "Not Equal" condition?

Offline

#4 2021-05-13 13:50:44

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,350
Website

Re: What is the correct SQLWhere for "Not Equal" condition?

Yes only =, IN , IS NULL, IS NOT NULL are supported by the mORMot in-mem static list.

Use the SQlite3 in-memory engine if you want full query support.

Update:
I have just implemented < <= <> != > >= value search for TRestStorageInMemory in mORMot 2.
Not mORMot 1 yet.

Offline

Board footer

Powered by FluxBB