Problems running Mysql function using Delphi FireDAC 10.1

0

In a MySql database I have a fully functional (Not a procedure) function, I can usually access within heidisql.

In Delphi, I do the following

function ExecutarFuncaoSQL(sFuncao: string; aParams: array of Variant; conBanco: TFDConnection): Variant;
begin
   with TFDCustomStoredProc.Create(nil) do
   try
      Connection := conBanco;
      Result := ExecFunc(sFuncao, aParams);
   finally
      Free;
   end;
end;

This is in line with what's on the Delphi website - > Delphi Documentation

However, when I try to run I get the following error

---------------------------
Debugger Exception Notification
---------------------------
Project InterfaceAPI.exe raised exception class EMySQLNativeException with message '[FireDAC][Phys][MySQL] PROCEDURE gravarconsulta does not exist'.
---------------------------
Break   Continue   Help   
---------------------------

Am I using the component the wrong way? Note: I want to avoid making direct by select

Edit 1 : When I run this function, it runs normally in BD (does Inserts and select), but I still have problems related to this returned error. I did new tests using another component, but nothing done.

with TFDStoredProc.Create(nil) do
    
asked by anonymous 10.08.2018 / 22:22

0 answers