Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check if query is finish

Status
Not open for further replies.

ryupb

MIS
Aug 31, 2004
25
US
Hi, I am currently stuck in this situation where I am running a remote view to one of the SQL servers in our workplace... because of its proximity there are times that the query takes some time and at other times its quite fast maybe because of the number of records being extracted at a given time...

my problem is this, after running the remote view there are a number of codes that needs to be process... assuming that the query finishes before the next line of codes, its ok... but what if the query takes some time... then the next line of codes will be processed without the complete extract of records due to the query taking some time...

is there a way that I can check the status of the query being run before the program continues to the next line????
 
Hi Rick.

I am making an assumption here that you are using SQL Passthrough

Why on earth would you make that assumption when he said that he was using a remote view [tongue] ?

Obviously, if he were using SPT, it would be easy ;-)

SQLEXEC( ) returns the number of result sets if there is more than one. SQLEXEC( ) returns 0 if it is still executing and returns 1 when it has finished executing. SQLEXEC( ) returns –1 if a connection level error occurs.

He could use that to determine if the query was finished executing...



Marcia G. Akins
 
Thanks for clearing this up Marcia. I answered the question after working 16 hours yesterday and *obviously* did not read it clearly.

BTW, so far Jeff and Bob have been kind to me, you do not follow any of my sessions in Tempe <gd&r vvvvvf> and I did not even request this!

_RAS
VFP MVP
 
Hi Rick.

>> I answered the question after working 16 hours yesterday <<

So business is good, eh? That is GREAT news!

I hope you did not take offense to my answer. I was teasing you. I know that there have been plenty of time when I have answered the wrong question ;-)

>> you do not follow any of my sessions in Tempe <gd&r vvvvvf> and I did not even request this! <<

Ooooh. I will have to e-mail them and especially request to follow you so I can come in and heckle at the end of your session.

See ya soon!



Marcia G. Akins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top