- Defined Oracle date/time types

- Fix for recognition of Float-fields
- Implemented support for ftDateTime
- support for ftBCD fields is implemented in r4000
- a fix for the size of string-fields is implemented in r4000

git-svn-id: trunk@4008 -
This commit is contained in:
joost 2006-06-29 22:33:14 +00:00
parent 391dc9a9fb
commit 3d06331560
4 changed files with 39 additions and 14 deletions

View File

@ -346,7 +346,7 @@ begin
OFieldType := SQLT_INT;
OFieldSize:= sizeof(integer);
end
else if (oscale = -127) and (OPrecision=0) then
else if (oscale = -127) {and (OPrecision=0)} then
begin
FieldType := ftFloat;
OFieldType := SQLT_FLT;
@ -367,7 +367,10 @@ begin
OCI_TYPECODE_DATE : FieldType := ftDate;
OCI_TYPECODE_TIMESTAMP,
OCI_TYPECODE_TIMESTAMP_LTZ,
OCI_TYPECODE_TIMESTAMP_TZ : FieldType := ftDateTime;
OCI_TYPECODE_TIMESTAMP_TZ : begin
FieldType := ftDateTime;
OFieldType := SQLT_ODT;
end;
else
FieldType := ftUnknown;
end;
@ -412,9 +415,7 @@ var dt : TDateTime;
size,i : byte;
exp : shortint;
cur : Currency;
ts : TTimeStamp;
dattim : ^TDateTime;
odt : POCIdateTime;
begin
with cursor as TOracleCursor do if fieldbuffers[FieldDef.FieldNo-1].ind = -1 then
@ -451,10 +452,8 @@ begin
move(dt,buffer^,sizeof(dt));
end;
ftDateTime : begin
dattim := fieldbuffers[FieldDef.FieldNo-1].buffer;
// dt := EncodeDate((b[0]-100)*100+(b[1]-100),b[2],b[3]);
// dt := ComposeDateTime(EncodeDate((b[0]-100)*100+(b[1]-100),b[2],b[3]), EncodeTime(b[4],b[5],b[6],0));
odt := fieldbuffers[FieldDef.FieldNo-1].buffer;
dt := ComposeDateTime(EncodeDate(odt^.year,odt^.month,odt^.day), EncodeTime(odt^.hour,odt^.min,odt^.sec,0));
move(dt,buffer^,sizeof(dt));
end;
else

View File

@ -2912,7 +2912,7 @@ uses ctypes,
POCIParam = pointer; // OCI PARameter descriptor
POCIComplexObjectComp = pointer; // OCI COR descriptor
POCIROWID = pointer; // OCI ROWID descriptor
POCIDateTime = pointer; // OCI DateTime descriptor
// POCIDateTime = pointer; // OCI DateTime descriptor
POCIInterval = pointer; // OCI Interval descriptor
POCIUcb = pointer; // OCI User Callback descriptor
POCIServerDNs = pointer; // OCI server DN descriptor

View File

@ -269,6 +269,32 @@ in define line 272 *)
// const
// MINSIZE_TMAXVAL:size_t = 4294967295;
type
POCITime = ^OCITime;
OCITime = packed record
OCITimeHH : ub1;
OCITimeMM : ub1;
OCITimeSS : ub1;
end;
POCIDate = ^OCIDate;
OCIDate = packed record
OCIDateYYYY : sb2;
OCIDateMM : ub1;
OCIDateDD : ub1;
OCIDateTime : OCITime;
end;
POCIDateTime = ^TOCIDate;
TOCIDate = packed record
Year : sb2;
Month : ub1;
Day : ub1;
Hour : ub1;
Min : ub1;
Sec : ub1;
end;
implementation
function UB1MASK : longint;

View File

@ -738,9 +738,9 @@
// OCI_TYPECODE_CFILE = SQLT_CFILE;
{ the following are ANSI datetime datatypes added in 8.1 }
{ SQL/OTS TIME }
// OCI_TYPECODE_TIME = SQLT_TIME;
OCI_TYPECODE_TIME = SQLT_TIME;
{ SQL/OTS TIME_TZ }
// OCI_TYPECODE_TIME_TZ = SQLT_TIME_TZ;
OCI_TYPECODE_TIME_TZ = SQLT_TIME_TZ;
{ SQL/OTS TIMESTAMP }
OCI_TYPECODE_TIMESTAMP = SQLT_TIMESTAMP;
{ SQL/OTS TIMESTAMP_TZ }
@ -748,9 +748,9 @@
{ TIMESTAMP_LTZ }
OCI_TYPECODE_TIMESTAMP_LTZ = SQLT_TIMESTAMP_LTZ;
{ SQL/OTS INTRVL YR-MON }
// OCI_TYPECODE_INTERVAL_YM = SQLT_INTERVAL_YM;
OCI_TYPECODE_INTERVAL_YM = SQLT_INTERVAL_YM;
{ SQL/OTS INTRVL DAY-SEC }
// OCI_TYPECODE_INTERVAL_DS = SQLT_INTERVAL_DS;
OCI_TYPECODE_INTERVAL_DS = SQLT_INTERVAL_DS;
{ Urowid type }
// OCI_TYPECODE_UROWID = SQLT_RDD;
{ first Open Type Manager typecode }