Board index » delphi » Aborting Queries

Aborting Queries

Is it possible to abort a Oracle or Sql Server (or whatever) query?
I know it should be possible because Oracle's Sql-Plus can do so, and
if it can be done by Oracle it surely can be done by Borland!

 

Re:Aborting Queries


Quote
In article <336a084f.3082...@news.xs4all.nl>, carda...@xs4all.nl wrote:
>Is it possible to abort a Oracle or Sql Server (or whatever) query?
>I know it should be possible because Oracle's Sql-Plus can do so, and
>if it can be done by Oracle it surely can be done by Borland!

This is an essential element and should be able to be done, but I have failed
to be able to successfully implement a strategy for Sybase servers.  You need
to look at using a callback function for the BDE.  You will need to set up the
calback using the DBIRegisterCallback function.  Look in help for more
information.  You might also want to check the Borland Web Site.  There is a
technical paper that shows an example of a callback to show query progress for
a desktop database, the principles of writing the code are the same.

Good luck and let me know if you have any success.

--
Bob McClintock

--
Bob McClintock

Re:Aborting Queries


Quote
> >Is it possible to abort a Oracle or Sql Server (or whatever) query?
> >I know it should be possible because Oracle's Sql-Plus can do so, and
> >if it can be done by Oracle it surely can be done by Borland!

It is unfortunate that this callback is only called after the server -
based query has run. I had to implement a thread using an ODBC connection
to be able to abort. The callback mechanism seems to work only for Paradox
/ DBase queries (local SQL).

Peter Antypas

Re:Aborting Queries


Quote
In article <01bc5984$62b33c80$8ed2d...@petera-w.turbopower.com>, "Peter Antypas" <petera@==turbopower.com> wrote:
>> >Is it possible to abort a Oracle or Sql Server (or whatever) query?
>> >I know it should be possible because Oracle's Sql-Plus can do so, and
>> >if it can be done by Oracle it surely can be done by Borland!

>It is unfortunate that this callback is only called after the server -
>based query has run. I had to implement a thread using an ODBC connection
>to be able to abort. The callback mechanism seems to work only for Paradox
>/ DBase queries (local SQL).

>Peter Antypas

Peter,

I assume your simply terminating the thread in order to terminate the query.  
Have you experienced any problems with either the server or client end in
terminating the query early?  For example, any leaks being left behind due to
the unexpected termination?  Just curious, because doing a query in a thread
was one route I considered, however I wasn't sure whether there would be any
problems.

Gerald

Other Threads