about XMLData fieldtype and value

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
isocchi
Posts: 3
Joined: Tue 25 Sep 2007 07:53

about XMLData fieldtype and value

Post by isocchi » Wed 19 Dec 2007 05:24

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 19 Dec 2007 10:08

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.

isocchi
Posts: 3
Joined: Tue 25 Sep 2007 07:53

Post by isocchi » Thu 20 Dec 2007 02:07

Thank you.
Isn't it possible to make it TFmtBcdField in ODAC?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 20 Dec 2007 08:33

No, ODAC doesn't have this feature.

Post Reply