Page 1 of 1

trying do get MySql Stored Procedure params

Posted: Wed 12 Oct 2016 13:37
by digiflash
This isn't working:

Connection := TMyConnection.Create(nil);
Connection.ConnectString := DBConnect;
SP := TMyStoredProc.Create(nil);
SP.Connection := Connection;
SP.Active := False;
SP.StoredProcName := 'GetTest';
SP.PrepareSQL;
SP.ParamByName('menge1').Value := 1;
SP.ExecProc;

ParamByName is causing an exception "Param not found".

Re: trying do get MySql Stored Procedure params

Posted: Wed 12 Oct 2016 13:56
by digiflash
found the problem. no capital letters in the procedure name. everything in lowercase.

Re: trying do get MySql Stored Procedure params

Posted: Wed 12 Oct 2016 14:30
by ViktorV
It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions about our products.

Re: trying do get MySql Stored Procedure params

Posted: Thu 13 Oct 2016 08:03
by digiflash
It is a problem with the privileges. What kind of calls does this "PrepareSql" call?
What schema or table do you access? I have to grant global "select" privileges.

Re: trying do get MySql Stored Procedure params

Posted: Thu 13 Oct 2016 10:00
by ViktorV
When calling the TMyStoredProc.PrepareSQL method, a query to MySQL system tables is executed: for MySQL server versions lower than 5.0.4 - to the mysql.proc table, otherwise - to INFORMATION_SCHEMA.ROUTINES.