1

I am using Zeoslib in Delphi to access a local MySQL database.

I call a stored procedure with the TZQuery object:

ZMakeRankedTable.SQL.Text :=
  'CALL MakeRankedTable(:tableA,:tableB,:SAMP_startTime,:SAMP_endTime,:Hourspan)';   

This stored procedure ends up filling a MySQL table with values.

I need to access these values, but I have no idea when MySQL is finished processing the query. I end up accessing the table before processing is complete.

Is there a .IsAvailable or .IsExecuting property I can access to determine whether my query has completed? If not, then how can I do it?

Mike Furlender
  • 3,869
  • 5
  • 47
  • 75

1 Answers1

3

There's no property available that indicates that your query is still running. But when the ZMakeRankedTable.Execute command terminates mysql should be ready processing the stored procedure. So I see only 3 situations where you can access the mysql table while the procedure results are not available yet.

  • You query from a parallel thread
  • You're querying from another connection, but the transaction of the 'stored proc connection' isn't finished (no autocommit nor commit happened)
  • Your stored proc launches a delayed process and returns immediately. Which is unlikely, as you need to do quite some work to have that effect in mysql.

mdaems

Project Admin Zeoslib

Mark Daems
  • 46
  • 1
  • Well, it should have a .IsAvailable or .IsExecuting property. Actually it should have a OnProcessing event so we could put a percentage or animation in the main thread user vcl. ;-) – NaN Aug 21 '12 at 19:03