Oracle 9i DATE field type

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
ameoba32
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 12.12.2005, 10:16

Oracle 9i DATE field type

Post 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.
ssamayoa
Junior Boarder
Junior Boarder
Posts: 29
Joined: 14.01.2006, 19:06

Post 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.
zarka
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 15.12.2005, 00:00

Post 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?
ssamayoa
Junior Boarder
Junior Boarder
Posts: 29
Joined: 14.01.2006, 19:06

Post by ssamayoa »

Checkout sources from CVS and build.
Those have the correct mapping.

Regards.
Post Reply