dbexpida46src, Delphi XE1: numeric parameter maping wrong

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for InterBase & Firebird in Delphi and C++Builder
Post Reply
nelson_integra
Posts: 4
Joined: Tue 21 Dec 2010 04:38
Location: Brasilia - DF - Brazil

dbexpida46src, Delphi XE1: numeric parameter maping wrong

Post by nelson_integra » Wed 05 Aug 2015 17:52

Hello

I need to map a out numeric parameter as ftFloat, but it is being mapped as ftFMTBcd.
I am using dbexpida46 with source code; Delphi XE1 Pro; Firebird 2.5.3.

SQL Connection Parameters:
  • DriverUnit=DBXDevartInterBase
    DriverAssemblyLoader=Devart.DbxIda.DriverLoader.TCRDynalinkDriverLoader,Devart.DbxIda.DriverLoader,Version=15.0.0.1,Culture=neutral,PublicKeyToken=09af7300eec23701
    MetaDataAssemblyLoader=Devart.DbxIda.DriverLoader.TDBXDevartInterBaseMetaDataCommandFactory,Devart.DbxIda.DriverLoader,Version=15.0.0.1,Culture=neutral,PublicKeyToken=09af7300eec23701
    DriverPackageLoader=TDBXDynalinkDriverLoader,DBXCommonDriver.bpl
    MetaDataPackageLoader=TDBXDevartInterBaseMetaDataCommandFactory,DbxDevartInterBaseDriver150.bpl
    ProductName=Interbase
    GetDriverFunc=getSQLDriverInterBase
    LibraryName=dbexpida40.dll
    VendorLib=fbclient.dll
    Database=R:\MyDatabase.fm10db
    User_Name=SYSDBA
    Password=masterkey
    SQLDialect=3
    MaxBlobSize=-1
    LocaleCode=0000
    DevartInterBase TransIsolation=ReadCommitted
    WaitOnLocks=True
    CharLength=1
    EnableBCD=False
    OptimizedNumerics=True

    LongStrings=True
    UseQuoteChar=False
    FetchAll=False
    UseUnicode=False
Sample Firebird Procedure DDL:

Code: Select all

create or alter procedure Teste1
returns ( Ret numeric(9,4) )
as
begin
  Ret = 3.1416;
  suspend;
end
I expect Ret parameter be mapped as ftFloat. But it is mapped as following parameters:
  • DataType: ftFMTBcdField
    NumericScale: 4
    ParamType: ptOutput
    Precision: 9
    Size: 9
And value returned is integer.

What is wrong? :roll:

Thanks in advance.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: dbexpida46src, Delphi XE1: numeric parameter maping wrong

Post by ViktorV » Thu 06 Aug 2015 09:56

Unfortunately, such behavioe is due to the specificity of DBExpress components implementation, and we can't affect this anyway. If you want to change the type of the out parameter to ftFloat, you can do it in design time.

nelson_integra
Posts: 4
Joined: Tue 21 Dec 2010 04:38
Location: Brasilia - DF - Brazil

Re: dbexpida46src, Delphi XE1: numeric parameter maping wrong

Post by nelson_integra » Fri 07 Aug 2015 05:32

I have tested two cases to discover the problem. It's strange:
I use Delphi XE1, TSQLConnection, and TSQLStoredProc (sp) component.

Case 1:
At design time in Delphi, when I set StoredProcName property from sp component, param is retrieved with DataType ftFMTBcd, NumericScale 4, Precision 9, and Size 9. That's ok. When I execute this procedure at design time, param is filled correctly as decimal value 3.1416.

Case 2:
But in runtime in compiled application, when I set StoredProcName property, param is retrieved as ftInteger DataType. And when I execute this procedure, param is filled as integer value 3. If I change param DataType to ftFloat before execute procedure, param DataType is changed to Integer and value returned is 3 too.

I certified that in same cases the database, driver file and SqlConnection parameters are equals.

I suppose that the driver have something about the problem.
What more could be wrong?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: dbexpida46src, Delphi XE1: numeric parameter maping wrong

Post by ViktorV » Tue 11 Aug 2015 08:27

Unfortunately, we can't reproduce the problem: we get the correct parameter value both at design-time and run-time. To investigate this behavior of dbExpress driver for InterBase and Firebird, please compose a small sample demonstrating the problem and send it to viktorv*devart*com

nelson_integra
Posts: 4
Joined: Tue 21 Dec 2010 04:38
Location: Brasilia - DF - Brazil

Re: dbexpida46src, Delphi XE1: numeric parameter maping wrong

Post by nelson_integra » Tue 11 Aug 2015 11:54

I migrated project to Delphi XE7 and problem was resolved.
I didn't any other change.
Thanks, Viktor.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: dbexpida46src, Delphi XE1: numeric parameter maping wrong

Post by ViktorV » Tue 11 Aug 2015 12:20

It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions about dbExpress driver for InterBase and Firebird.

Post Reply