Runtime-Error during ORACLE data selection (with activated D2010 Compiler Range-Check/Overflow checking)

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
wiwiechris
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 08.05.2014, 14:58

Runtime-Error during ORACLE data selection (with activated D2010 Compiler Range-Check/Overflow checking)

Post by wiwiechris »

Hallo @All
it seems that ORACLE-metadata are interpreted wrongly in some circumstances.

My test-setup:
* Have an ORACLE-table "XY" with "ColumnNameXY NUMBER(2)"
* Activate range checking and overflow checking in the D2010 compiler
* Make a select from table "XY"
* Run into an error in function "TZCachedResultSet.Fetch" in module "ZDbcCachedResultSet.pas" in line

case TZColumnInfo(ColumnsInfo).ColumnType of
stByte: RowAccessor.SetByte(I, ResultSet.GetByte(I));

=> The number is interpreted as a byte

* Change the ORACLE-Table "XY" to "ColumnNameXY NUMBER(3)"
* Make a select from table "XY"
* Column value is set correctly in "RowAccessor.SetShort", without errors

case TZColumnInfo(ColumnsInfo).ColumnType of
stShort: RowAccessor.SetShort(I, ResultSet.GetShort(I));

Conclusion:
* Deactivation of the D2010 compiler switches do not seem to produce (obvious) erros.
* For me, changing the ORACLE column type from "NUMBER(2)" to "NUMBER(3)" solved the problem.
BUT this cannot be the final solution.

Best regards
Chris

ZEOS Version 7.1.4-Stable
ORACLE 11.2.0.1
Delphi 2010

Christoph Wiwie
http://www.wiwie.de
Certified Tester/ Certified Requirements Engineer
Post Reply