On Tue, 24 Aug 2004 10:06:52 -0400, Joachim Engel wrote:
> Hi,
>
> does Informix provide the ability to abort long-lasting queries via API for
> client programs?
If you mean can the client app itself abort a long running query? Yes there
is a way. You have to register a call-back function (using the
sqlbreakcallback() function) and set a timeout to call the call-back function
prior to executing a possibly long-running query. See the ESQL/C Programmers
Manual. The callback function is called up to three times, when an SQL
statement begins, when it ends, and if the timeout occurs. When the call-back
is called it can check if a query is running (by calling the sqldone()
function) and if so sqlbreak() it then return.
Control returns just after the SQL statement that was interrupted with an
error (-213) indicating a user abort if sqlbreak() was called from the
call-back function (the same code you get if you ^C in dbaccess during a long
query).
Art S. Kagel
> TIA
> Joachim Engel.