How to Define and Execute Queries

Previous Next

See Also

Defining a Query

The Define button on the toolbar lets you define a query to retrieve data from the database. After you have chosen this option, all fields on the current window (and any of its related windows) will be cleared, awaiting your input. The shortcut key for this action is F2.

Executing a Query

When you have entered your search specifications in the various fields, click the Execute button to retrieve the corresponding data. The shortcut key for this action is F3.

Retrieving All Records

If you choose Execute without first entering search specifications, the query will retrieve ALL records from the current table. You can also retrieve all the records by clicking the All Records button on the toolbar. This is the equivalent of pressing F2 followed by F3.

When defining your search specifications, you may use any wildcard supported by your RDBMS.

Editing a Previous Query

You can also edit a previous query instead of having to define an entire new one. To do this, click the Edit Previous button on the toolbar, or press ALT+F2.

Sorting Query Results

You can sort all queried records on the column that is currently selected. This option toggles between ascending and descending order. You cannot sort columns that are based on a LONGRAW or LONG VARBINARY datatype. To sort the records, choose Query, Sort from the menu, or press F10.

Counting Query Results

Before you actually execute your query, you can count how many records it will return. If the number is very high, you might want to refine your query before executing it. To count the records, choose Query, Count from the menu bar, or press F4.

Canceling a Query

When you have finished querying, click the End button on the toolbar to cancel the process of defining a query. The system will then exit query mode, and return to insert/edit mode. The keyboard shortcut for this action is F6.