开发者

Zeoslib: How to tell when query execution is complete?

开发者 https://www.devze.com 2023-04-02 02:32 出处:网络
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 cod

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.

0

精彩评论

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