hello,
I'm having a problem in dynamically differentiating boolean fields from integer fields in Oracle.
Usually boolean fields are of type integer(1) in Oracle.
My question is : how can I retreive, using ODAC, the field size from the field type when it is integer(1) ?
Once I can get the size value of the integer type, I can easily differentiate between integer and boolean.
Thanks for your help.
Boolean fields in ODAC
You can use GetDataType, GetFieldScale and GetFieldPrecision methods of your DataSet object to retrieve such info.
For example:
For example:
Code: Select all
var
i : integer;
FieldName : string;
begin
with OraQuery1 do
for i := 0 to FieldCount-1 do begin
FieldName := Fields[i].FieldName;
if (GetDataType(FieldName) = dtInteger) and (GetFieldScale(FieldName) = 0) and
(GetFieldPrecision(FieldName) = 1) then
;//It's your boolean field
end;
end;