Icon View Incident Report

Minor Minor
Reported By: Chris Erdal
Reported On: 6/28/2006
For: Version 4.24 Build 1
# 2204 SQL Expressions Not Being Evaluated in Left-To-Right Order for Boolean Short-Circuiting

I'm setting up a script to do maintenance on a history-type file of payments due.

The first statement removes any payments (loyerDu) no longer due because a user has altered the start or end date of a contract (Location).

It works fine in DBSYS, but gives an error in a DBISAMQuery.ExecSQL. The error is:

Project project1.exe raised an exception class EConvertError with message ''' is not a valid integer value. Process stopped...

Pressing OK and F7 gives a new error box saying:

Project project1.exe raised an exception class EConvertError with message ''--01

These two messages are repeated apparently ad infinitum until I hit Ctrl-F2.

DELETE FROM LoyersDus
WHERE loyNum IN 
( SELECT loyNum
 FROM LoyersDus, Locations
 WHERE (loyLocation = locNum)
 AND (
       ((locDateFin <> NULL) AND (loyDate > CAST(CAST(EXTRACT
(YEAR,locDateFin) AS CHAR(4))+'-'+CAST(EXTRACT(MONTH,locDateFin) AS CHAR
(2))+'-01' AS DATE)))
       OR (loyDate < CAST(CAST(EXTRACT(YEAR,locDateDebut) AS CHAR(4))
+'-'+CAST(EXTRACT(MONTH,locDateDebut) AS CHAR(2))+'-01' AS DATE))
     )
)



Comments Comments
The exception was only being raised in the IDE while debugging. Normally, DBISAM traps the error and handles it. The problem was being caused by the Boolean short-circuit evaluation working right-to-left instead of left-to-right as expected.


Resolution Resolution
Fixed Problem on 6/30/2006 in version 4.25 build 1


Products Affected Products Affected
DBISAM Additional Software and Utilities
DBISAM ODBC Client-Server
DBISAM ODBC Client-Server with Source
DBISAM ODBC Standard
DBISAM ODBC Standard with Source
DBISAM ODBC Trial
DBISAM VCL Client-Server
DBISAM VCL Client-Server with Source
DBISAM VCL Standard
DBISAM VCL Standard with Source
DBISAM VCL Trial

Image