Get error with driver 6.4.6 on XE6: Type mismatch for field, expecting: FMTBcdField actual: BCD.

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
lgh
Posts: 5
Joined: Wed 06 Aug 2014 17:28

Get error with driver 6.4.6 on XE6: Type mismatch for field, expecting: FMTBcdField actual: BCD.

Post by lgh » Wed 06 Aug 2014 18:06

Hello,

We recently upgraded to Delphi XE6 and also updated our Devart drivers to the latest versions (both Oracle and SQLServer).

We have a very large client/server product with many persistent fields in various TClientDatasets. We use the database datatype numeric(m,p) on SQLServer (and number(m,p) on Oracle) for many persistent fields, mostly on the client-side. The corresponding persistent fields are currently defined as TFMTBCDField types. This worked correctly on Delphi XE2 and using the 6.0.1 driver.

Now with the current drivers (6.4.6 on SQLServer and 6.4.7 on Oracle) we are getting the error "Type mismatch for field, expecting: FMTBcdField actual: BCD" throughout our suite of applications.

This behavior seems to run counter to the documentation in the ReadMe.html that came with this version. For SQL Server, it indicates:

SQL Server type: numeric
Field type: ftFMTBcd
Field class: TFMTBCDField

The Oracle ReadMe is similar for the number datatype, and also indicates that there is a BCDPrecision property for which "[t]he default value of this option is '0,0' (do not use TBCDField)". Since we do not use the BCDPrecision property, I would assume the default would hold and that TFMTBCDField would be used instead of TBCDField.

Is this a bug? If so, is a fix planned relatively soon? Is there a work-around?

Or is this intended behavior? If so, does the documentation need updating? What was the reason for this change?

We would have to update hundreds of declarations in hundreds of source files, but I can use a grep tool to do it. I would rather not, especially if this is something that will be changed again in the future.

Thank you for your time.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Get error with driver 6.4.6 on XE6: Type mismatch for field, expecting: FMTBcdField actual: BCD.

Post by azyk » Fri 08 Aug 2014 12:10

Thank you for the information. We have reproduced this problem.

For dbExpress Driver for SQL Server we will add the extended BCDPrecision option. This option will define how to interpret the NUMERIC datatype: as TBCDField or TFMTBCDField. This fix will be included in one of the next build.

In order to dbExpress Driver for Oracle interprets NUMBER as TFMTBCDField, before connect to a DB, set in the connection parameters the BCDPrecision extended driver option to '0,0'. for instance:

Code: Select all

SQLConnection.Params.Add('BCDPrecision=0,0');

lgh
Posts: 5
Joined: Wed 06 Aug 2014 17:28

Re: Get error with driver 6.4.6 on XE6: Type mismatch for field, expecting: FMTBcdField actual: BCD.

Post by lgh » Fri 08 Aug 2014 17:58

Thank you for the reply. I'm glad you were able to reproduce the problem.

I am unable to get the 'BCDPrecision=0,0' change to work for Oracle. When running against both Oracle 12c and 11g, I get the same type mismatch error as indicated previously. I also tried other precision values, but the results were the same.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Get error with driver 6.4.6 on XE6: Type mismatch for field, expecting: FMTBcdField actual: BCD.

Post by AlexP » Fri 15 Aug 2014 09:21

This option should be set before establishing a connection.

lgh
Posts: 5
Joined: Wed 06 Aug 2014 17:28

Re: Get error with driver 6.4.6 on XE6: Type mismatch for field, expecting: FMTBcdField actual: BCD.

Post by lgh » Fri 15 Aug 2014 16:48

I made sure that was the case when testing it. I tried both by setting it in the INI file we use and setting it in code just before the connection to Oracle is established. I still receive the same error. Since this doesn't appear to be working for us in Oracle, I'm concerned that when you implement the same parameter for the SQL Server drivers that will also not work for us.

Are you not able to replicate this problem with the Oracle drivers?

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Get error with driver 6.4.6 on XE6: Type mismatch for field, expecting: FMTBcdField actual: BCD.

Post by azyk » Tue 23 Jun 2015 07:43

We can't reproduce the described issue on the latest version of dbExpress driver for Oracle. Please download and update your driver version to 6.6.9 and let us know if the issue repeats. The latest version download is available at: https://www.devart.com/dbx/oracle/download.html .

rwerning
Posts: 17
Joined: Wed 20 Feb 2008 21:09

Re: Get error with driver 6.4.6 on XE6: Type mismatch for field, expecting: FMTBcdField actual: BCD.

Post by rwerning » Thu 28 Jan 2016 19:42

I've taken over this issue for the original poster (LGH). We're trying to evaluate the latest version of the devart dbExpress drivers (we use both Oracle & Sql Server), as we're still using the ones from 2012 (v6.0.1 of each). We're currently using Delphi XE6 to create a 64bit executable. I suspect the drivers are the cause of another issue we're seeing, and was hoping to evaluate and see if the latest version solves this new issue we're seeing.

I've tested Sql Server (dbexpsda40.dll) v7.1.2, and by setting SqlConnection.Params.Add('BCDPrecision=0,0') before open, bcd fields are correctly set to fmtBCD. However when I try the same test with Oracle (dbexpoda40.dll) v6.7.10, I receive the following error:

Project ServerTest.exe raised exception class EDatabaseError with message 'qCommCrit: Type mismatch for field 'CRIT_REV', expecting: FMTBcdField actual: BCD'.

For reference, here is the list of sqlconnection.params we use:
'GetDriverFunc=getSQLDriverORA'
'DriverUnit=DBXDevartOracle'
'DriverAssemblyLoader=Devart.DbxOda.DriverLoader.TCRDynalinkDriverLoader,Devart.DbxOda.DriverLoader,Version=1.0.0.5001,Culture=neutral,PublicKeyToken=09af7300eec23701'
'LibraryName=dbexpoda40.dll'
'VendorLib=oci.dll'
'BlobSize=-1'
'ErrorResourceFile='
'LocaleCode=0000'
'Oracle TransIsolation=ReadCommited'
'ProductName=Oracle'
'RowsetSize=20'
'Multiple Transaction=False'
'Trim Char=False'
'Decimal Separator=.'
'UseQuoteChar=True'
'UseUnicode=True'
'Profile Type=TIPQA'
'Driver=DevartOracle'
'DriverName=DevartOracle'
'BCDPrecision=0,0'

I appreciate any assistance you can give. I would prefer we get to the latest version of the drivers ASAP.
Thank you,
Rich
TIP Technologies, Inc

rwerning
Posts: 17
Joined: Wed 20 Feb 2008 21:09

Re: Get error with driver 6.4.6 on XE6: Type mismatch for field, expecting: FMTBcdField actual: BCD.

Post by rwerning » Thu 28 Jan 2016 23:22

I tracked down the solution to our problem while trying to make a test case to submit. It seems that we needed to set EnableBCD to true for Oracle. It's odd because in our connection files we don't have it set to true for SqlServer and it works there. But by setting the param for Oracle it works fine, and setting it true in SqlServer has no impact.

SqlConnection1.Params.Values['EnableBCD'] := 'True';
SqlConnection1.Params.Values['BCDPrecision'] := '0,0';

This solved our problem
Rich

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Get error with driver 6.4.6 on XE6: Type mismatch for field, expecting: FMTBcdField actual: BCD.

Post by azyk » Tue 02 Feb 2016 06:12

Glad to see that the issue was resolved. If any other questions come up, please contact us.

Post Reply