Code: Select all
dtTimeStamp, dtTimeStampTZ, dtTimeStampLTZ,
dtIntervalYM, dtIntervalDS:
// if (Field.DataType <> dtString) then begin // mjf: original line: doesn't check for dtWideString
if ((Field.DataType <> dtString) and (Field.DataType <> dtWideString)) then begin // mjf: fixed line
Field.Length := Field.DBLength;
if Field.DataType = dtIntervalDS then
Field.Scale := Field.DBScale;
end
else
// case OraType of // mjf: original line: incorrectly checking the Oracle type SQLT_ constants instead of the odac dt* types
case Field.SubDataType of // mjf: fixed line
dtTimeStamp, dtTimeStampLTZ:
Field.Length := GetNlsFieldDesc(nlsTimeStampFormat);
dtTimeStampTZ:
Field.Length := GetNlsFieldDesc(nlsTimeStampTZFormat);
dtIntervalYM:
Field.Length := Field.DBLength + 4; // interval year to month form is +Prec-MM
dtIntervalDS:
Field.Length := Field.DBLength + Field.DBScale + 11; // interval day to second form is +Prec HH:MM:SS.Scale
end;
Thanks,
Mark Ford
Benthic Software