[bug?]"Range check error" and EConvertError with D
Posted: 11.03.2008, 08:17
Me again.
I'm taking "Range check error" when active ZTable at design and EConvertError at runtime. This occur if a table has a field Timestamp. I'm using "zeos 6.6.2-RC" with protocol oracle9i to connect in Oracle 10g.
The exception EConvertError raise in ZDbcOracleResultSet.pas, near of line 657:
------------------------------------------
Result := Result + EncodeTime(
Hour, Minute, Second, Millis);
------------------------------------------
I checked the values Hour, Minute, Second and Millis, all are numbers. The value of Millis was a large number like 123456789, but the argument MSec in EncodeTime should be <= 999 (Delphi Component Reference). To fix I do that:
------------------------------------------
uses
..., StrUtils;
...
{begin add}
Millis := StrToInt(LeftStr(IntToStr(Millis), 3)); // included in line 558
{end add}
Status := FPlainDriver.DateTimeGetTime(
Connection.GetConnectionHandle,
FErrorHandle, PPOCIDescriptor(SQLVarHolder.Data)^,
Hour, Minute, Second, Millis);
// CheckOracleError(FPlainDriver, FErrorHandle, Status, lcOther, '');
if Status = OCI_SUCCESS then
begin
if Result >= 0 then
begin
Result := Result + EncodeTime(
Hour, Minute, Second, Millis);
end
else
begin
Result := Result - EncodeTime(
Hour, Minute, Second, Millis);
end;
end;
------------------------------------------
I don't take more EConvertError at runtime, just a "Range check error" when active ZTable in design. This is ok or is better not use zeos with Oracle 10g?
I'm taking "Range check error" when active ZTable at design and EConvertError at runtime. This occur if a table has a field Timestamp. I'm using "zeos 6.6.2-RC" with protocol oracle9i to connect in Oracle 10g.
The exception EConvertError raise in ZDbcOracleResultSet.pas, near of line 657:
------------------------------------------
Result := Result + EncodeTime(
Hour, Minute, Second, Millis);
------------------------------------------
I checked the values Hour, Minute, Second and Millis, all are numbers. The value of Millis was a large number like 123456789, but the argument MSec in EncodeTime should be <= 999 (Delphi Component Reference). To fix I do that:
------------------------------------------
uses
..., StrUtils;
...
{begin add}
Millis := StrToInt(LeftStr(IntToStr(Millis), 3)); // included in line 558
{end add}
Status := FPlainDriver.DateTimeGetTime(
Connection.GetConnectionHandle,
FErrorHandle, PPOCIDescriptor(SQLVarHolder.Data)^,
Hour, Minute, Second, Millis);
// CheckOracleError(FPlainDriver, FErrorHandle, Status, lcOther, '');
if Status = OCI_SUCCESS then
begin
if Result >= 0 then
begin
Result := Result + EncodeTime(
Hour, Minute, Second, Millis);
end
else
begin
Result := Result - EncodeTime(
Hour, Minute, Second, Millis);
end;
end;
------------------------------------------
I don't take more EConvertError at runtime, just a "Range check error" when active ZTable in design. This is ok or is better not use zeos with Oracle 10g?