Page 1 of 1
Stored Procedures
Posted: Wed 02 Jun 2010 20:48
by sandro.carrara
Hi, I'm using trial version to understand if MyDAC has same feature I need for my projects.
I've have a first question:
where can I find an example of TMyStoredProc that uses inpèut and output parameters?
Delphi 2007
MySQL 5.1.4
Thanks
Posted: Thu 03 Jun 2010 09:31
by Dimon
You need only to define the StoredProcName property, and parameters for a stored procedure will be created automatically.
The example of code for using parameters of stored procedure:
Code: Select all
MyStoredProc.StoredProcName := ProcName;
MyStoredProc.ParamByName(InputParameter).AsInteger := 1;
MyStoredProc.ExecProc;
Value := MyStoredProc.ParamByName(OutputParameter).AsString;
Posted: Sat 12 Jun 2010 09:47
by sandro.carrara
My problem is that the program doesn't recognize the paramaters (neither input or outpu).
I can see them in MyStoredProc Editor.
If I set the input value in editor it works but if I set it in Delphi program I receive the error: Parameter 'input_parameter' not found.
Thanks
Posted: Mon 14 Jun 2010 12:37
by Dimon
To solve the problem call TMyStoredProc.PrepareSQL before setting parameter values.