Page 1 of 1

dbexpida46src, Delphi XE1: numeric parameter maping wrong

Posted: Wed 05 Aug 2015 17:52
by nelson_integra
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.

Re: dbexpida46src, Delphi XE1: numeric parameter maping wrong

Posted: Thu 06 Aug 2015 09:56
by ViktorV
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.

Re: dbexpida46src, Delphi XE1: numeric parameter maping wrong

Posted: Fri 07 Aug 2015 05:32
by nelson_integra
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?

Re: dbexpida46src, Delphi XE1: numeric parameter maping wrong

Posted: Tue 11 Aug 2015 08:27
by ViktorV
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

Re: dbexpida46src, Delphi XE1: numeric parameter maping wrong

Posted: Tue 11 Aug 2015 11:54
by nelson_integra
I migrated project to Delphi XE7 and problem was resolved.
I didn't any other change.
Thanks, Viktor.

Re: dbexpida46src, Delphi XE1: numeric parameter maping wrong

Posted: Tue 11 Aug 2015 12:20
by ViktorV
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.