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.
精彩评论