Bug #2718
implicit conversion of empty string to integer 0
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
version:
History
#1 Updated by Ovidiu Maxiniuc over 8 years ago
Investigations on a failing customer testcase revealed new difference between static and dynamic queries.
The following static code:
DEFINE TEMP-TABLE tt001 FIELD int-field AS INTEGER. CREATE tt001. FIND FIRST tt001 WHERE tt001.int-field EQ "".
is invalid and the attempt to run this query gives error 223:
Incompatible data types in expression or assignment
.
Replacing the static query with
DEFINE VARIABLE tth AS HANDLE NO-UNDO. tth = BUFFER tt001:HANDLE. tth:FIND-FIRST('WHERE tt001.int-field EQ ""'). MESSAGE tth::int-field.
will print
0
in the message area, without any complaint. Initializing the int-field
after record is created to anything than 0
(including ?
- unknown value), will result in following error messages to be printed:** FIND FIRST/LAST failed for table tt001. (565) ** No tt001 record is available. (91)
as a proof that the FIND-FIRST is indeed looking for
0
value.