简体   繁体   中英

Zeoslib: How to tell if query is still processing?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM