Problem with DBX Driver 4 and Stored Procedures

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
mvs1972
Posts: 1
Joined: Tue 09 Oct 2007 09:03

Problem with DBX Driver 4 and Stored Procedures

Post by mvs1972 » Tue 09 Oct 2007 09:10

Hello,

After installing the new driver 4.00.2 I noticed that my application has problems with executing funtions and stored procedurs on the MySQL Server 5.1.20. I use the following software Delphi 2005

On the mysql server I have a simple stored function with 2 input parameters for example integer(11) and a Char(15)
The result of this function is a double(15,4) an I call this function with the following delphi code

Function GetResult(Param1 : Integer; Param2 : String; MySQL : TSQLConnection) : Extended;
Var
QueryResult : TSQLStoredProc;
Begin
QueryResult:= TSQLStoredProc.Create(nil);
QueryResult.SQLConnection := MySQL;
QueryResult.StoredProcName := 'F_GET_RESULT';
QueryResult.Params.ParamByName('vparam1').value := Param1;
QueryResult.Params.ParamByName('vparam2').value := Param2;
QueryResult.ExecProc();
Result := QueryResult.Params.ParambyName('Result').AsFloat;
QueryResult.Free;
end;

When this code is executed I get the message that there is an error in my SQL syntax. Project project.exe raised exeception class EdatabaseError with message ‘Database Server Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ 100)’at line 1’.

It looks like it goes wrong when the parameters are send to the SQL server but I don’t know that for sure.

When I use the new dbexpmda.dll deliverd with this new version it goes wrong. When I use the old dbexpmda.dll deliverd with version 3, there is no problem executing the function.

Is there a way to solve this problem.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 10 Oct 2007 12:17

Thank you for information. We have already fixed this problem. This fix will be included in the next build of DbxMda, which will be available in a couple of days.

Post Reply