trying do get MySql Stored Procedure params

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
digiflash
Posts: 3
Joined: Wed 12 Oct 2016 13:26

trying do get MySql Stored Procedure params

Post by digiflash » Wed 12 Oct 2016 13:37

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".
Last edited by digiflash on Wed 12 Oct 2016 14:40, edited 1 time in total.

digiflash
Posts: 3
Joined: Wed 12 Oct 2016 13:26

Re: trying do get MySql Stored Procedure params

Post by digiflash » Wed 12 Oct 2016 13:56

found the problem. no capital letters in the procedure name. everything in lowercase.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: trying do get MySql Stored Procedure params

Post by ViktorV » Wed 12 Oct 2016 14:30

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.

digiflash
Posts: 3
Joined: Wed 12 Oct 2016 13:26

Re: trying do get MySql Stored Procedure params

Post by digiflash » Thu 13 Oct 2016 08:03

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.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: trying do get MySql Stored Procedure params

Post by ViktorV » Thu 13 Oct 2016 10:00

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.

Post Reply