About

EMS MySQL Query is an utility for quick and simple building SQL queries to MySQL databases. Visual building as well as direct editing of a query text is available. User-friendly graphical interface allows you to connect to databases, select tables and fields for a query, set the selection criteria and much more. You can work with several queries at once, edit queries and view the execution results in several modes and perform any other operations you may need in your work with database queries.

Main features:
· Registering databases for working with the required databases only.
· Possibility of working with several queries in separate windows.
· Multiple database connections.
· Visual selecting tables and fields for the query by drag&drop.
· History of recently used queries with a possibility of navigating between them and selecting the required queries.
· Syntax highlight, "quick code" and keyboard templates for faster editing query text.
· Fully customizable interface, including interface language.
· And many other features...

Product Information:

Homepage: http://www.ems-hitech.com/mysqlutils/index,phtml#query

Support E-mail: support@mysqlutils.com

Register on-line at: http://www.ems-hitech.com/mysqlutils/purchase.phtml


What's New in MySQL Query?

Version 1.7.0.1 - October 25, 2004

1. Now the time of execution of a query and the number of returned/affected records are shown.

2. You can export the query results to Clipboard now.

3. Working with grids you can now use the Ctrl+C shortcut to copy to Clipboard the cell content.

4. On opening the query window the access violation error appeared, if the 'Query Builder \ Condition Button Style' option value was different from the 3D-look. The bug is fixed.

5. Other minor improvements and bugfixes.


Getting Started

The first step in your work with MySQL Query should be registering a database (or a number of databases), which you plan to work with.

To register a database select the Database | Register Database regdb menu item (Shift+Alt+R) or click the appropriate button on the toolbar.

Then set the database properties in the Register Database Dialog.

Host
A host name where the database is situated or the IP address of the server.

Port
A TCP/IP port for connecting to the database server.

User Name
User name for connecting to the database server.

Password
Password for connecting to the server.

Database Name
Select the database name to register.

Database Alias
Any database alias that is convenient for you (e.g. mysql or My Test Database). This alias will be displayed in the DB Explorer window.

Database Font Charset
Character set to display data in the grid.

chbox Login prompt before connection
Enables MySQL Query to prompt for user name and password each time you connect to the database.

chbox Use SSL protocol
Enables using encrypted protocol when connecting to the database server. To use this option your MySQL server must support SSL protocols.

chbox Use compression protocol
Enables using the compressed data protocol when connecting to the database server.

chbox Interactive mode
Enables using the interactive_timeout variable in my.cnf file instead of wait_timeout.

chbox Quote identifiers
Enables quoting all the identifiers by the backquote symbol `. Note that this option works only with servers that support quoting aliases.

chbox Autoconnect on startup
Enables automatic establishing connection with the registered database on MySQL Query startup.

On the Log tab you can also set the following options:

chbox Enable Log of SQL Editor queries
Enables logging SQL queries and error messages to the SQL log file.

SQL Editor log file
Specifies the log file name to save queries and error messages into.

You can copy all registration options from another registered database by clicking the Copy Alias from... button. It drops down with a list of already registered databases, allowing you to select one for copying its properties.

When you are done, click Test Connect to check the connection with the database. To finish the process of registering, click Register.

You can also register a number of databases, located on one host, at once. Select the Database | Register Host reghost menu item (Shift+Ctrl+R) or click the appropriate button on the toolbar.

The connection properties on the first step of the Register Host Wizard are the same as in the Register Database Dialog. On the second step you should select the databases for registering by moving them from the Available Databases list box to the Selected Databases.

On the third step you can select a database in the list and tune its options in the same way as it is described above.

When you are done, click Register to finish the process.

After you have registered a database or several databases, the DB Explorer panel at the left looks in the following way:

To connect to a database double-click its alias in the DB Explorer or select it and click the Connect to Database connect button on the toolbar. If connection is established successfully, the database alias becomes bold and its node expands showing all the database tables.

Now you can start creating queries for this database and execute them.


Building Query

To create a query select the Query | New Query menu item vqb or click the appropriate button on the toolbar. Set an optional name for the new query (it is used, e.g. for keeping the query history).

Now you can edit the new query on the Edit or Builder tab of the Query Editor.

Edit Tab

The Edit area is provided for working with the text of the query. To make editing faster you can drag tables and fields from the DB Explorer and drop them to the edit area. Dropping a table adds a SELECT statement for this table to the query, and dropping a field adds a field name to the cursor position.

For your convenience the Quick Code system is enabled, i.e. when you type first word symbols in the SQL text editor you are offered some variants for the word completion in a popup list (analogue of the Code Insight in Delphi IDE). You can activate these popup lists yourself by pressing the following key combinations:

Ctrl+Space All SQL keywords and database objects
Ctrl+Alt+S SQL glossary
Ctrl+Alt+T Table list
Ctrl+Alt+U UDF list
Ctrl+Alt+F MySQL function list

Database objects are highlighted in the text. You can open the proper object editor by clicking the object name in the text, holding button Ctrl pressed on the keyboard.

The popup menu of the edit area contains standard functions for working with the text (Cut, Copy, Paste, Find, Replace, Toggle Bookmarks, etc) and also functions for processing the whole query, which allow you to execute/prepare query, save/load query to/from file, and preview/print query.

Builder Tab

On the Builder area you can build your query by placing the database tables on the area, selecting the required data and setting links between objects.

To add a table to the query, choose the required object in the DB Explorer table list, then double-click it or drag it to the Builder area. The selected table will appear on the Builder area with the list of its fields. To include a table field in the query, click at the left of the field name in the list or double-click it to set the blue icon next to the field name. To include all the fields, set a flag at the left of the object alias. To remove the fields from the query, uncheck the fields; to remove the object, close it by clicking the button 'X' next to the object alias. To edit the object alias, double-click the alias.

To associate database objects by two fields, just drag one field from the object list to another. This will set a link between these objects by the selected fields. When you drop a field, a line will appear between the linked fields. You can view and edit the properties of object association. To do that, aim cursor to the link line. A hint, containing the association condition, will appear. To edit the properties, double click the line or right-click and choose Properties item from the popup menu. A dialog window will appear, where you can change the association condition by choosing it from the list (=, >, <, >=, <=, <>). Also you can check or uncheck Include all from <object_name> option for each object, included into the association. Click 'OK' to confirm the changes you made. To drop a link between objects, right-click on the link line and choose Delete Link item from the popup menu. To delete all the links of some object, click button '-' next to the object alias. To insert a point to the link line, right-click on the line and choose Insert Point item from the popup menu. A new point will appear, using which you can move the link line. It doesn't cause any changes in the query but makes the diagram performing more obvious and the visual building handler.

To set other query properties, use tabs at the lower part of the window.

Criterions
On this page you can set the selection conditions. To add a condition, click button at the left and select 'Add condition' in the popup menu. Edit the condition by clicking its parts and setting their values. Clicking the button at the left of the condition string activates the popup menu, which allows you to add a new condition of the same enclosure level, add a new enclosure level, delete the current condition, open or close the condition, if it is composite. A simple condition string contains three fields: an argument, a condition and a second argument (if required for the condition). Clicking each field allows you to set its value. Clicking the argument field allows editing it as a text field. You can set a table name or a definite value in this field. Right-clicking the field in the edit mode activates the popup menu, which contains the Insert Field function (also called by Shift+Enter). This function allows you to choose a field from the list of all the table fields, available in the query. Clicking the condition field activates the popup menu, where you choose the condition you need. The way of proceeding the condition is set in the upper string of the area (All, Any, None, or Not all of the following are met). Click the underlined word to change it.

Selection
This page displays the output fields of the query. It allows you to edit the names of the query output fields, set their displaying order and set the aggregate functions (SUM, MIN, MAX, AVG, and COUNT) for each field. To remove the field from the list, right-click the field row and choose 'Delete current row' from the popup menu. To change the input query field, double click it and then type the field name on the keyboard or choose it from the drop-down list.

To change the output query field name, double click it and type the field name on the keyboard.
To set the aggregate function for the field, double click the field row in the Aggregate column and then type the function name on the keyboard or choose it from the drop-down list.

chbox Include only unique records
If you check this option the repeated records are not included into the query result.

Grouping Criterions
On this page you can set the conditions for grouping the query records. They are set in the same way as the selection conditions (see above). These conditions will be included into the HAVING statement of the current query.

Sorting
Set the way of sorting the query records on this page. The field list at the left represents all the output query fields; the list at the right contains fields, by which the query records will be sorted. To move the field from one list to another, drag the selected field or use buttons 'Add' and 'Remove'. To change the sorting order, select a field in the right list and move it using buttons 'Up' and 'Down'. To change the sorting direction, select a filed in the right list and switch the direction (Ascending, Descending) using button 'A..Z'/'Z..A'.

Execute Query

To execute the query click the Execute execute button on the toolbar or press F9. If the query text is correct, the query executes and the Results area opens at the lower part of the window with the data returned by the query. If an error occurs while executing the query, execution stops, and the error message is displayed in the bottom area.

The Results area allows viewing the query result data set in two modes: as a grid or as a form. The buttons of the navigation panel (see picture below) work in the following way: go to the first records in the set, go to the previous record, go to the next record, go to the last record, refresh data.

The popup menu of the grid view allows you to set filter for displaying data, set to record to null, to empty string, to now (depends on the field data type). The form view provides easier editing, especially for string or date/time fields.

Save/Load Queries

You can save/load a query text or a builder diagram. To save current query to SQL file just click the Save save button on the toolbar and set the filename in the dialog. To save it as a diagram click the down-arrow near the save button and select Save Diagram.

To save an already saved query to another file, click the Save As saveas button (or select the Save Diagram As in the same way).

To load a previously saved query, click the Load Query load button on the toolbar and load an SQL file or a builder diagram from file.

All recently edited queries are saved on the History tab of the Query Editor. In the left part of this area the list of edited queries is displayed. Date is date and time when this query was edited and Name is the name you set on creating the query.

Select a query in the list to display its text in the right part of the window. This text can't be edited here. To make a query active and available for editing and executing, just double-click the required query in the list. It opens in the Edit area and you can work with it in the way described above.


Environment Options

Use Environment Options to tune the general program options, including options of the query builder, result grids and so on. To call this dialog select the Options | Environment Options menu item.

Preferences

chbox Save desktop on disconnect
Saves all the database windows and their positions on disconnecting from the database.

chbox Play sounds
Turns the MySQL Query sound effects on.

chbox Disable multiple instances
Prohibits running multiple instances of MySQL Query.

chbox Encrypted passwords
Encrypts passwords for connecting to databases in the Windows registry.

chbox Show hosts in DB Explorer
Shows/hides database hosts in the DB Explorer tree.

History
Check option Use History to keep the history of edited queries and set the number of queries to keep in the History Depth box.

chbox Show history for the current query only
Check this option to display the whole query history, or uncheck it to display the history only for the current query.

Confirmations

chbox Confirm exit from MySQL Query
If this option is on, the program requires confirmation when you want to exit MySQL Query.

chbox Confirm successful compilation
If this option is on, the program requires confirmation for the successful compilation.

DB Explorer

chbox Show hosts in DB Explorer
Shows/hides database hosts in the DB Explorer tree.

chbox Show history in DB Explorer
Shows/hides query history in the DB Explorer tree.

Query Builder

chbox Select condition row
Displays the selected condition in different row on the Criteria and Grouping Criteria tabs of the Query Builder.

chbox Drag field name
Displays the dragged field name in the Builder area.

chbox Hide selection when inactive
Hides the selection when Query Builder is inactive.

chbox Show field types in hints
Displays the field type next to the field in the table box.

Visible Tabs
These options specify which Query Builder tabs are available and which are not. Check boxes to make the appropriate tabs visible.

Script Format
These options specify the case formatting of keywords and functions in query text on the Edit tab. As is saves the original case, Uppercase sets all the keywords/functions to upper case, Lowercase sets all the keywords/functions to lower case, and First upper sets the first letters of all keywords/functions to upper case.

Style
These options specify how different the Query Builder objects look like - 3D, flat, etc.

Color Palette
These options define colors of different Query Builder objects: condition row, active caption, table client area, etc. Click an item to select a color for the appropriate Query Builder object.

Fonts

System Font Name
Defines the font name used by MySQL Query.

System Font Size
Defines the font size used by MySQL Query.

The box below displays the sample text using the selected font.

Grid

Grid
Defines the background color of the data grid.

Row
Defines the color of the selected row in the data grid.

Stripy
Defines the color of the odd rows if the Stripy Grids option is on.

Text
Defines the text that stands for the NULL value.

Font Color
Defines the font color displaying NULL values in the grid.

Integer Fields
Defines the format for displaying TINYINT, SMALLINT, MEDIUMINT, INTEGER, and BIGINT fields.

Float Fields
Defines the format for displaying FLOAT, DOUBLE and DECIMAL fields.

DateTime Fields
Defines the format for displaying DATETIME fields.

Date Fields
Defines the format for displaying DATE fields.

Time Fields
Defines the format for displaying TIME fields.

String Fields Width
Defines the width of CHAR and VARCHAR fields displayed in the grid.

chbox Select all records
Selects all the records from the table, no matter how many records there are in table.

Records
This option is available only if Select all records is off. It defines the maximum number of records, selected from the table at a time.

chbox Stripy Grids
Displays the odd grid rows in a different color, defined by the Stripy option.

chbox Autofit Columns
This option is available only if Save Grid View is off. It shrinks the grid columns so that the longest visible column value fits.

chbox Save Grid View
This option is available only if Autofit Columns is off. It saves the original grid width.

chbox Use Ctrl+Up to increase spin values
Allows you to use Ctrl+Up and Ctrl+Down key combinations for editing the spin values (integer field values).

chbox Show editor immediately
Allows editing the cell value right after the cell is clicked.

Localization

The Localization tab is provided for managing the MySQL Query localization files.

You can create your own *.lng files similar to those, available in the $(MySQL Query)\Languages folder, add them to the list of available languages on this tab and set the new language as a program interface language.

Default Directory
The default directory for adding the new *.lng files.

Choose Program Language
Selects the program interface language.

Available Languages
Lists all the languages available for localization and the corresponding *.lng files. Double-click a language in the list to edit its name or *.lng file.

Add Defaults
Searches in the Default Directory folder for the *.lng files and adds all them to the list.

Add
Opens a dialog for setting the name and the corresponding file of a new language file.

Edit
Opens a dialog for changing the name or the corresponding *.lng file of the language selected in the Available Languages list box.

Delete
Removes the language selected in the Available Languages list box.

Reports

Default Paper Size
This panel allows you to select the default paper size from the four available choises.

Default Page Orientation
Selects the default page orientation - Portrait or Landscape.

chbox Autofit Row Height
Check this option to fit the row heights to the paper size.


Editor Options

Editor Options allow you to set the parameters of viewing and editing the SQL statements within MySQL Query.

To call the Editor Options window select the Options | Editor Options menu item.

General

chbox Auto Indent
If this option is checked, each new indention is the same as the previous when editing SQL text.

chbox Insert Mode
If this option is checked, insert symbols mode is on by default.

chbox Use Syntax Highlight
Enables syntax highlight in the object editor window.

chbox Find Text at Cursor
If this option is checked, Text to Find field in the Find Text Dialog window is automatically filled with the text, the cursor is set on.

chbox Always Show Hyperlinks
If this option is checked, hyperlinks are displayed in the editor window. To open a link click it with the Ctrl button pressed.

chbox Show Number of Lines
If this option is checked, line numbers are displayed in the SQL text editor window.

Tab Stops
Defines the tab length, used when editing a text.

Undo Limit
Defines the maximum possible number of changes to be undone.

Display

chbox Visible Margin
Makes the right text margin visible.

chbox Visible Gutter
Makes the gutter visible in the editor window.

Right Margin
Defines the position of the right text margin in the editor window.

Gutter Width
Defines the gutter width in the editor window.

Editor Font, Size
Use these options to set the editor font and its size.

Color

On this tab you can set font and background colors and attributes of the text, editor uses to mark out different text fragments: default, comments, strings, SQL keywords, numbers, links, wrong symbols, identifiers, symbols, and selected text.

Quick Code

chbox Code Completion
If this option is checked, then on typing the first word symbols in the SQL text editor you are offered some variants for the word completion in a popup list (analogue of the Code Insight in Delphi IDE). The popup list will appear at the time, defined by Delay option.

Delay
Using this option you can change the time the popup list takes to appear.

Code Case
Allows you to change the case of the words inserted automatically.

chbox Use Keyboard Templates
Allows you to use keyboard templates for faster typing regularly met expressions (see Keyboard Templates).

chbox Emulate Typewriting
Defines the delay of displaying symbols on the screen.

chbox Color Scope Categories
If this option is checked, object types differ in color in the popup menu.

Sort By Scope / Sort By Name
Switches sorting objects in the popup menu by name or by type (Table, UDF, etc.).


Visual Options

This window allows you to customize the application interface style to your liking. To call this window select the Options | Visual Options menu item.

Scheme Name
Select the interface scheme you like: Classic Windows or Windows XP style.

You can create your own interface schemes by customizing any visual options you like on the appropriate tabs (Bars and Menus, Trees and Lists, Edit Controls, Check Boxes and Page Controls) and clicking the button Save As.

You can also delete your own scheme by clicking Delete. 'Classic Style' and 'Windows XP' schemes can't be deleted.

All the customizing you make is displayed on the Sample panel.

Bars and Menus

Bar Style
Choose the style of displaying the application toolbars. Check the 'Sunken border' option to change the panel display style.

Menu Animation
Choose the style of animating the menu items. Use also options at the right to customize the application menus.

Trees and Lists

Look and Feel
Choose the style of flatting the application trees and lists.

Tree Lines Style
Choose the style of displaying the application tree lines.

Border Style
Choose to display or not the borders of the application trees and lists.

Use options at the right to customize the object selection in the application trees and lists.

Edit Controls

Border Style
Choose the style of displaying the borders of the application controls.

Button Style
Choose the style of displaying the application buttons.

Button Transparence
Choose the style of displaying the transparent buttons.

Edges
Check the edges to display in the application controls.

Use also Hot Track and Shadow options to customize the application control view accordingly.

Check Boxes

Border Style
Choose the style of displaying the borders of the application check boxes.

Button Style
Choose the style of displaying the check box buttons.

Button Transparence
Choose the style of displaying the transparent check box buttons.

Edges
Check the edges to display in the application check boxes.

Use also Hot Track and Shadow options to customize the application check box view accordingly.

Page Controls & Buttons

Tab style
Choose the style of displaying the application tabs.

Button Kind
Choose the style of program buttons.

Use also Multiline pages and Hot track options to customize the application tab view accordingly.


Keyboard Templates

The Keyboard Templates window allows you to create new keyboard templates for quicker typing regular met expressions and to edit the existing ones. To call this window select the Options | Keyboard Templates menu item from the popup menu.

You can deactivate the existing template by choosing it from the list at the left of the window and removing the flag from its name. Also you can edit template name, using button Edit, delete a template, using button Delete and edit template expression in the right part of the window. For faster editing you can use the Symbols menu and buttons Author, Time, Date.

To add a new template, click Add, set the template name and define the template expression. In the upper left corner of the window you can choose the case of the template expression.