[fpc-pascal] Patch: new XML export for FCL-DB ready forinclusion, issue 19790 - includes Delphi Clientdataset
Ludo Brands
ludo.brands at free.fr
Thu Jul 28 14:36:34 CEST 2011
> > - bcd: invalid field type
> Ok, what field type do we need ;) I'll wait for your further
> investigations.
Line 2087 becomes:
ftBCD: //WIDTH=precision, DECIMALS=scale
//negative DECIMALS not allowed !!! oracle does allow negative
scale
begin
TDOMElement(ColumnNode).SetAttribute('fieldtype', 'fixed');
TDOMElement(ColumnNode).SetAttribute('WIDTH', '20' );
TDOMElement(ColumnNode).SetAttribute('DECIMALS',
IntToStr(ExportFields.Fields[ItemCounter].Field.size) );
end;
Note that precision and scale are poorly implemented in sqldb. I checked
both oracle and mysql and support for precision and scale is barely present
and severely limiting scale values. Reason for the fixed width in above
code. 20 should fit double type values since scale is limited to 4. So no
exponentes.
Haven't tested negative scales as allowed in oracle yet. I know Delphi 2006
crashes on negative values but I can't tell yet if negative scales ripple
through to TFieldDef.size.
> >
> > - the mysql text types (tinytext,text, longtext, etc) are
> exported as
> > bin.hex with subtype binary. Perhaps a problem in the mysql code.
> Ok.
> Am looking at test coverage, might be a good idea for medium
> term to use current sqldb testing framework so we can use eg
> Firebird employee sample database or an mysql database. For
> now, I'll wait for your further investigations.
The sqldb mysql implementation doesn't distinguish text from blob. Nothing
that can be done about in the export.
Ludo
More information about the fpc-pascal
mailing list