Kbase P125896: DataServer for MS SQL Server generates faulty SQL syntax when using a Logical field in a WHERE claus
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  22/04/2008 |
|
Status: Unverified
FACT(s) (Environment):
OpenEdge 10.1B
OpenEdge 10.1B01 32-bit Service Pack
OpenEdge 10.1B02 32-bit Service Pack
MS SQL DataServer
Windows
MS SQL
SYMPTOM(s):
No records returned by query when using a logical field in the WHERE clause
Example query:
FOR EACH Item WHERE (FALSE AND Item.ACTIVE) OR TRUE:
DISP Item.NAME.
END.
Query should return all records in the table
DataServ.lg shows that the following SQL syntax is generated:
HH:MM:SS Execute on 0x1442540 Firehose Connection Level 1 old: SELECT PROGRESS_RECID, "itemcode" FROM "Item"."dbo"."item" WHERE ((1 = 2 AND "active" = 1)) ORDER BY "itemcode"
CHANGE:
Installed Service Pack 2 for OpenEdge 10.1B
CAUSE:
Bug# OE00152614
FIX:
Option #1
Upgrade to 10.1B03 or later
Option #2
Change the expression order in the WHERE clause:
FOR EACH Item WHERE TRUE OR (FALSE AND Item.Active):
DISPLAY Item.Name.
END.
Option #3
Use Item.Active = TRUE:
FOR EACH Item WHERE (FALSE AND Item.Active = TRUE) OR TRUE:
DISPLAY Item.Name.
END.