BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to stop a query?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Vander
Guest





PostPosted: Fri Aug 20, 2004 2:30 pm    Post subject: How to stop a query? Reply with quote



Hi all

Win98, Delphi5, Interbase/Firebird, Zeos components

I'd like to know if there is a way to stop an executing query.
For example: I could show a modal form with a "Cancel" button, then start
the query. If the user want to stop it, just press the button.
Is it possible to do it using a second thread? How to implement?

Thank you

Vander


Back to top
Martijn Tonies
Guest





PostPosted: Fri Aug 20, 2004 3:21 pm    Post subject: Re: How to stop a query? Reply with quote



Hi,

Quote:
Win98, Delphi5, Interbase/Firebird, Zeos components

I'd like to know if there is a way to stop an executing query.
For example: I could show a modal form with a "Cancel" button, then start
the query. If the user want to stop it, just press the button.
Is it possible to do it using a second thread? How to implement?

InterBase 6.5 and up has a query-cancel API. This works
very well.

Firebird doesn't have this.

I don't know if Zeos exposes this functionality.


--
With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com



Back to top
Vander
Guest





PostPosted: Fri Aug 20, 2004 4:09 pm    Post subject: Re: How to stop a query? Reply with quote



Thanks Martijn...

Vander


Quote:

InterBase 6.5 and up has a query-cancel API. This works
very well.

Firebird doesn't have this.

I don't know if Zeos exposes this functionality.


--
With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS
SQL
Server.
Upscene Productions
http://www.upscene.com





Back to top
Craig Stuntz [TeamB]
Guest





PostPosted: Fri Aug 20, 2004 5:09 pm    Post subject: Re: How to stop a query? Reply with quote


Martijn Tonies wrote:

Quote:
I don't know if Zeos exposes this functionality.

As long as you can get a statement handle, you can just call
isc_dsql_free_statement without needing it wrapped by your query
components.

Also, note that there are two parts to cancelling SELECTs. During
execution, you need to use isc_dsql_free_statement. But during
fetching result sets you just have to stop fetching.

-Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
How to ask questions the smart way:
http://www.catb.org/~esr/faqs/smart-questions.html

Back to top
Vander
Guest





PostPosted: Fri Aug 20, 2004 6:30 pm    Post subject: Re: How to stop a query? Reply with quote

That's the point:
How can I get a statement handle?
If the program call a query (a SELECT for example) it wait for the query
results and we can't call any statement!
Is there a way?

Vander

"Craig Stuntz [TeamB]" <cstuntz (AT) nospam (DOT) please [a.k.a. vertexsoftware.com]>
escreveu na mensagem news:41263055$2 (AT) newsgroups (DOT) borland.com...
Quote:

Martijn Tonies wrote:

I don't know if Zeos exposes this functionality.

As long as you can get a statement handle, you can just call
isc_dsql_free_statement without needing it wrapped by your query
components.

Also, note that there are two parts to cancelling SELECTs. During
execution, you need to use isc_dsql_free_statement. But during
fetching result sets you just have to stop fetching.

-Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
How to ask questions the smart way:
http://www.catb.org/~esr/faqs/smart-questions.html



Back to top
Vander
Guest





PostPosted: Fri Aug 20, 2004 6:33 pm    Post subject: Re: How to stop a query? Reply with quote

Hi

Quote:

As long as you can get a statement handle, you can just call
isc_dsql_free_statement without needing it wrapped by your query
components.

Is there a way to get a statement handle in this case?

Thanks

Vander

Quote:

Also, note that there are two parts to cancelling SELECTs. During
execution, you need to use isc_dsql_free_statement. But during
fetching result sets you just have to stop fetching.

-Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
How to ask questions the smart way:
http://www.catb.org/~esr/faqs/smart-questions.html



Back to top
Martijn Tonies
Guest





PostPosted: Fri Aug 20, 2004 6:37 pm    Post subject: Re: How to stop a query? Reply with quote

Quote:
As long as you can get a statement handle, you can just call
isc_dsql_free_statement without needing it wrapped by your query
components.

Is there a way to get a statement handle in this case?

That depends on the Zeos library - you need to get the
native InterBase handle for the statement.


--
With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com



Back to top
Vander
Guest





PostPosted: Fri Aug 20, 2004 6:46 pm    Post subject: Re: How to stop a query? Reply with quote

Sorry my mistake, the message was sent twice.

"Vander" <vander (AT) pucrs (DOT) br> escreveu na mensagem
news:41264379$1 (AT) newsgroups (DOT) borland.com...
Quote:

Hi


As long as you can get a statement handle, you can just call
isc_dsql_free_statement without needing it wrapped by your query
components.

Is there a way to get a statement handle in this case?

Thanks

Vander


Also, note that there are two parts to cancelling SELECTs. During
execution, you need to use isc_dsql_free_statement. But during
fetching result sets you just have to stop fetching.

-Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
How to ask questions the smart way:
http://www.catb.org/~esr/faqs/smart-questions.html





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.