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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Detect if SQL View is finish

Status
Not open for further replies.

madhatter2002

Programmer
Nov 6, 2002
73
PH
I have these views created for the SQL data. For some data that is not that big, data fetch is fast making the view accessible. However, there are cases wherein the number of data is really big, and I get the busy notification.

Is there a way to detect if the view is still fetching so that the program will need to wait until the fetch is complete. I am using MS SQL as back end.

thanks for the suggestions.
 
madhatter2002,

The easiest solution is to issue GO BOTTOM immediately after you open or requery the view. This will, in effect, force the view to run synchronously, so the problem you are experiencing won't arise.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
I have used a combination of approaches:

OPEN DATABASE MyDBC
USE MyView IN 0
SELECT MyView
=CURSORSETPROP("FetchSize",-1,"MyView")

* --- Ensure That SQL Query Has Completed Before Going On ---
LabelHand = CURSORGETPROP("ConnectHandle","MyView")
DO WHILE SQLGETPROP(LabelHand,"ConnectBusy")
=INKEY(5,"H")
ENDDO
SELECT MyView

The FetchSize property should, by itself halt additional processing until the entire data set has been retrieved.
Therefore the subsequent code might be un-necessarily redundant, but it works.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top