Page 1 of 1

MyStoredProc and Stored Functions

Posted: Mon 17 Nov 2014 07:12
by rshera
Hi
I'm using mydac84 with Delphi XE7 (running on Windows 8.1 64 bit) and I'm having an issue when using the MyStoredProc component with a stored function. In a test program, I'm using the following function

Code: Select all

CREATE DEFINER = 'root'@'localhost' FUNCTION `f_test`(
        `a` INTEGER
    )
    RETURNS TINYINT(1)
    DETERMINISTIC
    CONTAINS SQL
    SQL SECURITY DEFINER
    COMMENT ''
BEGIN

  RETURN if(a > 10, 1, 0);
END;
In my program I call it by

Code: Select all

 MyStoredProc1.ParamByName('a').asInteger := SpinEdit1.Value;
  if MyStoredProc1.Active then MyStoredProc1.Refresh else MyStoredProc1.Active := true;
  if MyStoredProc1.ParamByName('result').asBoolean then
    ShowMessage('true')
  else
    ShowMessage('false');
The result is always false (0), regardless of the value of a.

If I run the component in design mode, it correctly returns a 0 or 1 depending on the value of a.

In previous versions with Delphi XE6 it worked correctly from within the program.

I have tried using a dbExpress (dbxmda65) and this works correctly, but I have quite a few instances of using stored functions in my program and don't really want to have to track them all down and rewrite them.

Can anyone confirm that this is a bug?

Thanks
Robert

Re: MyStoredProc and Stored Functions

Posted: Wed 19 Nov 2014 08:58
by ViktorV
Thank you for the information. We have reproduced and fixed the issue. The fix will be included in the next MyDAC build, that will be available for download the next week.