简体   繁体   中英

Zeoslib: How to tell when query execution is complete?

I am using ZeosLib within Delphi to call a MySQL stored procedure through the TZQuery object. Immediately after MySQL finishes execution of the stored procedure I need to initiate my next block of code.

I added a SELECT 1; statement at the end of my MySQL stored procedure. What is the best way to find out that the results have been returned?

Zeos lib does not play nice with stored procedures that return a result set.
It actively disables the returned resultset.
There is a workaround for that, you can activivate the resultset by altering the ZEOS source code.

However when you do that, you get lots of errors like MySQL has gone away .
At unpredictable times, which is probably why they disabled this option in the first place.

In the end the workaround I went for is to put any resultset that I need in a (temporary) table and query that after the stored procedure finishes. This solved the errors and works well for me.

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