#1 2017-10-18 06:20:17

lagodny
Member
Registered: 2015-01-28
Posts: 50

Something wrong with parentheses in WHERE

I have an external DB and class

  TSQLSKU = class(TSQLRecord)
  private
    FTitleLocal: RawUTF8;
  published
    property TitleLocal: RawUTF8 index 100 read FTitleLocal write FTitleLocal;
  end;

Line

      aSKU := TSQLSKU.CreateAndFillPrepare(Server, 'TitleLocal is null OR TitleLocal = ''''');

work correctly.

But line

      aSKU := TSQLSKU.CreateAndFillPrepare(Server, '(TitleLocal is null) OR (TitleLocal = '''')');

does not work.

I think constructor TSynTableStatement.Create does not work properly.

Offline

#2 2017-10-18 13:32:13

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

Re: Something wrong with parentheses in WHERE

Don't put any parenthesis, which are not mandatory in SQL, here.

This is currently a known limtation.

Online

#3 2017-10-19 12:08:54

lagodny
Member
Registered: 2015-01-28
Posts: 50

Re: Something wrong with parentheses in WHERE

OK. Thanks for reply.

Offline

Board footer

Powered by FluxBB