Return a Result set from a storedeProcedure MySql

0

Good afternoon. I have the following storedprocedure in MySql ..:

DELIMITER $$    
CREATE DEFINER='ricardo'@'%' PROCEDURE 'teste2'()
BEGIN   
Select * from Tabela;    
END

How do I call this storedprocedure by DELPHI 7 ?
I'm using the ZEOS components. I already tried with the zQuery ..: Call test2; open..exeqsql .. did not work.
I have tried with ZStoredProc1 .. also did not work .. it does not even load properti the name of storedprocedure. I know I could do a sql directly on the component, but the one described above is just an example. The procedure performs several operations and at the end there is an sql to be returned. However , even in the example above, a simple sql, I could not return storedprocedure in delphi to be viewed on a grid. Home Thanks in advance for your attention!)

    
asked by anonymous 22.09.2018 / 21:42

1 answer

0
  

If the stored procedure returns a cursor to be used with visual data controls, add a data source component to the data module and set its DataSet property to the data set of the stored procedure type. Connect data-aware components to the data source using their DataSource and DataField properties.

You should use "Active" property of the "StoredProcedure"

ZStoredProc1.Prepare;
ZStoredProc1.Active:= True;

Reference

    
24.09.2018 / 20:10