开发者

Zeoslib: How to tell if query is still processing?

开发者 https://www.devze.com 2023-04-02 22:58 出处:网络
I am using Zeoslib in Delphi to access a local MySQL database. I call a stored procedure with the TZQuery object:

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消