Problems running Mysql function using Delphi Firedac 10.1

Asked

Viewed 184 times

0

In a Mysql database I have a function (not Procedure) fully functional, I can access normally within heidisql.

At Delphi, I’ll tell you what

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;

That’s according to what’s on the Delphi website ->Delphi documentation

However, when I try to execute 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 doing direct by select

Edit1: When I run this Function, it runs normally in BD(makes Inserts and select), but I still have problems related to this error returned. I made new tests using another component, but nothing done.

with TFDStoredProc.Create(nil) do
  • Bruno, that gravarconsulta that he’s screaming in the output, he’s being called from somewhere?

  • I call [Function Executarfuncaosql] like -> Executarfuncaosql('gravarconsulta', [param1, param2 .....])

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.