| Queries
A query is used to extract data from the database in a readable format according
to the user's request. Navicat MySQL provides two powerful tools for working
with the SQL queries: Query Editor for editing the query text directly and
Query Builder for building queries visually.
Just sample click to open an object pane for Query.
A right-click displays the popup menu or using the object pane toolbar below,
allowing you to create new, edit, open and delete the selected query.

Edit Query
To edit the existing query
- Select the query for editing in the navigation pane/object pane.
- Right-click and select the
Design
Query from the popup menu.
or
- Click the
Design Query from the
object pane toolbar.
- Modify query on the Query Editor/Query Builder tab.
To change the name of the query
- Select the query for editing in the navigation pane/object pane.
- Right-click and select the Rename from the popup menu.
Open Query
To open a query (manage query data)
- Select the query for opening in the navigation pane/object pane.
- Right-click and select the
Open Query
from the popup menu or simply double-click the query.
or
- Click the
Open Query from the object
pane toolbar.
Note: Only SELECT queries will be run
automatically with results being displayed on Result tab.
Run Query
To run a query
- Create a new query/open the existing query.
- Click
Run. (Click
Stop to terminate the running)
- View/edit the returned data on the Result tab.
To run a saved query from the command line (set schedule)
- Create and save the query.
- Start Navicat from command line - start_navicat
/query ConnectionName DatabaseName QueryName
| Note: |
ConnectionName -> name of the connection |
| |
DatabaseName -> name of the database |
| |
QueryName -> name of the saved query |
To run a saved export query profile from the command line (export query result,
set schedule)
- Create and save the query export profile.
- Start Navicat from command line - start_navicat /exportquery ConnectionName
DatabaseName ExportProfileName
| Note: |
ConnectionName -> name of the connection |
| |
DatabaseName -> name of the database |
| |
QueryName -> name of the saved export profile |
Delete Query
To delete a query
- Select the query for deleting in the navigation pane/object pane.
- Right-click and select the
Delete Query
from the popup menu.
or
- Click the
Delete Query from the
object pane toolbar.
- Confirm deleting in the dialog window.
|