Share via


Running Queries

After you finish building your query, you can execute the query to obtain the results. Visual FoxPro executes the SQL SELECT statement generated by the Query Designer, and sends the results to a browse window. For more information about building queries, see Creating Queries.

To run a query from the Query Designer

  1. Open the query in the Query Designer before you run it.
  2. From the Query menu, select Run Query.

Visual FoxPro displays the results of the query in a browse window.

You can also run a query from the Project Manager without opening the query by selecting the name of the query from the Queries node in the file tree view and choosing Run.

Directing the Results of Your Query

You can send the results of your query to a different destination for output, such as a cursor, table, or screen. By default, Visual FoxPro displays the results of your query in a browse window.

When you choose Query Destination on the Query menu, or choose the Query Destination button on the Query toolbar, the Destination dialog box displays, so you can choose where to send your query results.

To choose a query destination

  1. From the Query menu, choose Query Destination.
  2. In the Query Destination dialog box, choose an output destination, and fill out any additional fields as required.

The following table describes destinations for query output.

Output option Destination
Browse Display the results of the query in a browse window.
Cursor Save the results of the query in a temporary read-only table with a name that you specify.
Table Save the results of the query as a table with a name that you specify.
Screen Display the results of the query in the main Visual FoxPro window or in the currently active output window.

See Also

Organizing Query Results | Customizing Queries | Browse window | SELECT - SQL COMMAND | Query Destination Dialog Box | Querying Multiple Tables and Views | Updating Data in a View | Creating Queries