Page 1 of 1

about XMLData fieldtype and value

Posted: Wed 19 Dec 2007 05:24
by isocchi
Hi support.
It's assumed to include the following data on the table.

create table TABLE1(
KEY1 VARCHAR2(3) NOT NULL,
NUMDATA1 NUMBER(7,3)
NUMDATA2 NUMBER(7,3)
);
/

select * from TABLE1;

KEY1 NUMDATA1 NUMDATA2
---- -------- --------
001 0.7 0.35
002 0.7 0.35

When I access this data in ODAC, and XML is acquired in TClientDataSet.XMLData, it'll be as follows.
















When it's operated in dbExpress equally, a result changes.
















NUMDATA1 will be the strange value and be a problem at the time of use of data.
Why is this?
Please tell me whether there isn't a way to avoid.

Thanks

Posted: Wed 19 Dec 2007 10:08
by Plash
ODAC creates TFloatField for NUMDATA1 and NUMDATA2. dbExpress creates TFmtBcdField for these columns. Therefore XML is different.

You can set EnableBcd driver option to False. In this case TFloatField will be created by dbExpress. You can use the following code to set EnableBcd option:

Code: Select all

const
  coEnableBCD = TSQLConnectionOption(102);

...

  SQLConnection1.Open;
  SQLConnection1.SQLConnection.SetOption(coEnableBCD, Integer(False));
If you use TCRSQLConnection component, you can set EnableBcd option in Params property of TCRSQLConnection. In Delphi 2007 you also can set this option in Params property with standard TSQLConnection component.

Posted: Thu 20 Dec 2007 02:07
by isocchi
Thank you.
Isn't it possible to make it TFmtBcdField in ODAC?

Posted: Thu 20 Dec 2007 08:33
by Plash
No, ODAC doesn't have this feature.