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

SQL Select Question 2

Status
Not open for further replies.

Atlas

Programmer
Sep 20, 1999
26
US
How do I close the table used in the Select statement. If I run the statement the first query runs but if I try to use the Select file for anything else I get message &quot;File is in use&quot;.&nbsp;&nbsp;How do I share this file so I can run multiple queriers.<br><br>thanks<br><br>Atlas
 
By default the SELECT creates a cursor named QUERY and leaves it open in another work area. You could issue SELECT QUERY to get to it. I'm not sure about sharing the result table. You may want to try a VIEW instead. What is the purpose of the query? Would all users be running the query or is it something that only runs on init?
 
Are you selecting into a cursor (the default) or into a table?&nbsp;&nbsp;Selecting into a cursor (such as Query, the default) shouldn't be a problem, because VFP automatically overwrites it with subsequent results.&nbsp;&nbsp;Selecting into a table could be a problem, though.<br><br>If the problem is that the SELECT can't open one of your <i>source</i> tables, that's a bit odd.
 
It sounds like you may have the SET EXCLUSIVE setting set to ON.&nbsp;&nbsp;With this setting on, any table may only be opened once. Try SET EXCLUSIVE OFF before running your query.<br>
 
Are you trying to use one of the table that you used in the FROM clause of your SELECT statement?&nbsp;&nbsp;If thats the case, I think all table that you've specify in the FROM clause are automatically opened and will remain opened until you close them explicitly.&nbsp;&nbsp;If if you want to access one of these table(s), instead if USE, simply SELECT the work area.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top