How to retrieve values from a Stored Procedure
Posted: Wed 21 Nov 2007 10:03
Hello,
I have a stored procedure as follows:
CREATE DEFINER = 'root'@'localhost' PROCEDURE `Get_MyValue`(IN cnr cHAR(10))
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
Select cbk_category from cbk
Where cbk_cnr=cnr;
END;
If I call this procedure from an sql statement like this:
Call Get_MyValue("S10155")
Then I can see every row displayed (like the result of a normal Select).
How can I retrieve the rows (because there might be many rows) from Delphi, calling the stored procedure?
The following code doesn't work, it will never enter in the iteration:
while not eof do
Begin
ShowMessage(FieldByName('cbk_category ').AsString);
Next;
end;
I use Delphi 2006 and MyDac 4.40.0.24.
If my version is not capable to do that but the version 5 is, than I am willing to upgrade.
By the way how can I see the difference between the version 4 and 5?
When should I expect the version 6? If it is not so far it would be easier for me to upgrade directly to 6.
Thank you in advance
I have a stored procedure as follows:
CREATE DEFINER = 'root'@'localhost' PROCEDURE `Get_MyValue`(IN cnr cHAR(10))
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
Select cbk_category from cbk
Where cbk_cnr=cnr;
END;
If I call this procedure from an sql statement like this:
Call Get_MyValue("S10155")
Then I can see every row displayed (like the result of a normal Select).
How can I retrieve the rows (because there might be many rows) from Delphi, calling the stored procedure?
The following code doesn't work, it will never enter in the iteration:
while not eof do
Begin
ShowMessage(FieldByName('cbk_category ').AsString);
Next;
end;
I use Delphi 2006 and MyDac 4.40.0.24.
If my version is not capable to do that but the version 5 is, than I am willing to upgrade.
By the way how can I see the difference between the version 4 and 5?
When should I expect the version 6? If it is not so far it would be easier for me to upgrade directly to 6.
Thank you in advance