Page 1 of 1

Oracle 9i DATE field type

Posted: 12.12.2005, 11:32
by ameoba32
Bug description
Oracle DATE field type stores date AND time. So apropriate field in delphi is TDateTime. ZeosLib thinks diffrent and in delphi i get TDate and time portion is lost.

i found this bug in bugtracker
http://sourceforge.net/tracker/index.ph ... tid=415824

Solution:
Two patches:

ZDbcOracleUtils.pas
function ConvertOracleTypeToSQLType(TypeName: string;
Size: Integer; Precision: Integer): TZSQLType;

**Replace
else if TypeName = 'DATE' then
Result := stDate
**With
else if TypeName = 'DATE' then
Result := stTimestamp


ZDbcOracleResultSet.pas

**Replace
SQLT_DAT, SQLT_DATE:
CurrentVar.ColType := stDate;
**With
SQLT_DAT, SQLT_DATE:
CurrentVar.ColType := stTimestamp;

Plz, tell me where can i submit patches so bugs can be quickly fixed.

Posted: 14.01.2006, 19:18
by ssamayoa
You are wrong.

DATE data type in Oracle 8.x WAS the equivalent of "new" (for Oracle 9.x+) TIMESTAMP data type.

In other words:

8.x's DATE = 9.x's TIMESTAMP
8.x's TRUNC(DATE) = 9.x's DATE

Regards.

Posted: 13.02.2006, 11:03
by zarka
Hi guys,

I have some similar problem.
In an Oracle (8.0.5) table there is a DATE type column.
I tried to read with oracle or oracle9i into a DBGrid (TopGrid) with ZTable
and ZQuery too.
I always got the following error:
SQL Error: ORA-00932: Incompatible data types.

What would be the reson?

Posted: 16.02.2006, 13:36
by ssamayoa
Checkout sources from CVS and build.
Those have the correct mapping.

Regards.