Page 1 of 1

MSSQL stored procedure ParamByName

Posted: Tue 12 Aug 2014 22:21
by martind1
TUniStoredProcedure.ParamByName doesn't find any parameter when addressing
procedures with output parameter. FindParam yields nil.
However Params works fine.

Code: Select all

create procedure IS_WFRO_PERS_OK
  @WFRO_NR varchar(30),
  @BVOR_ID int,
  @PERS_ID int,
  @OK int output
as ...
This message appears when doubleclick on such a component in the form editor:
Image

Using UniDAC Version 5.3.10 for Delphi XE2 with MSSQL 2008
Edit: After downgrading to 4.5.10 all works

Re: MSSQL stored procedure ParamByName

Posted: Fri 15 Aug 2014 12:47
by azyk
We failed to reproduce the issue, when the TUniStoredProcedure.ParamByName method does not find any parameters for the stored procedure containing the output parameter. Please try reproduce the problem on our UniDacDemo project - and let us know the results. The UniDacDemo project is in the folder "ะก:\Program Files\Devart\UniDAC for RAD Studio XE2\Demos\UniDacDemo\"

If the problem can't be reproduced on our demo, try to compose a small sample to demonstrate the problem and send it to andreyz*devart*com.

We reproduced and fixed the error, taking place when double-clicking the TUniStoredProcedure component, that is located on the project form. This fix will be included in the next UniDAC build.

Re: MSSQL stored procedure ParamByName

Posted: Mon 18 Aug 2014 19:50
by rkaule
Hi,

Any ETA as to the update to fix this problem?

Thanks,
Bob

Re: MSSQL stored procedure ParamByName

Posted: Wed 20 Aug 2014 09:24
by PavloP
We can send the night build, containing fix for the design-time editor issue. To receive it, please send your license number to support*devart*com.

Re: MSSQL stored procedure ParamByName

Posted: Fri 29 Aug 2014 19:41
by martind1
the error with ParamByName occurs when the parameters are stored in the .dfm with @-prefixes.

Code: Select all

  object procIS_WFRO_PERS_OK: TUniStoredProc
    StoredProcName = 'dbo.IS_WFRO_PERS_OK'
    Connection = DlgLogon.Database1
    Left = 368
    Top = 480
    ParamData = <
      item
        DataType = ftInteger
        Name = 'Ergebnis'
        ParamType = ptResult
      end
      item
        DataType = ftString
        Name = '@WFRO_NR'
        ParamType = ptInput
      end
      item
        DataType = ftInteger
        Name = '@BVOR_ID'
        ParamType = ptInput
      end
      item
        DataType = ftInteger
        Name = '@PERS_ID'
        ParamType = ptInput
      end
      item
        DataType = ftInteger
        Name = '@OK'
        ParamType = ptOutput
      end>
    CommandStoredProcName = 'dbo.IS_WFRO_PERS_OK'
  end
Older versions of unidac handle these '@' without problem.
I think these names came from the migrated BDE projects (or from an very old unidac).

Re: MSSQL stored procedure ParamByName

Posted: Tue 02 Sep 2014 08:45
by azyk
Thank you for the information. We have reproduced the problem and will investigate it.

Re: MSSQL stored procedure ParamByName

Posted: Thu 04 Sep 2014 13:19
by azyk
In SDAC, parameters for stored procedures are named so that they don't contain the @ leading symbol. UniDAC behavior for SQL Server for this case is implemented so that it doesn't differ from the one of SDAC. To solve the problem, please delete the @ leading symbol in the parameter names of the used TUniStoredProc components.

Re: MSSQL stored procedure ParamByName

Posted: Fri 05 Sep 2014 23:47
by martind1
Your suggestion is accepted.
Thanks for treatment of the topic.
I wonder why this was possible in earlier versions.

Re: MSSQL stored procedure ParamByName

Posted: Tue 09 Sep 2014 10:09
by azyk
We will change this behavior for compatibility with SDAC.