Autocomplete
The purpose of the autocomplete feature of SQLyog is to make it ease to type any type of database object (tables, columns etc.) names, and the names of MySQL keywords and functions. The feature makes use of a small database engine that is built into SQLyog. SQLyog is shipped with a database with the names of MySQL keywords and functions and for every connection that it uses it will retrieve and maintain a list of the object names for each connection.
Also with long and/or awkward object names this feature reduces the possibility of misspelling and thus saves you time and reduce the risk of accidentally executing wrong queries and reaching wrong conclusions.
Autocomplete basically functions in four and independent different ways.
1) 'Auto-popup' or 'tooltip'.
Whenever you type in an object name followed by "." the available object in the level below will pop up in a small window from where you can select using arrow-keys and ENTER. For instance try typing a database name like "mydb." to see the list of tables in the 'mydb'-database. And type a "mytable." and a list of columns in that table is displayed. Also typing the name of a function followed by "(" will display the parameter list of that function. Try typing "ABS(" yourself.
Finally when only one possible match is left, autocomplete will tell you and you only need to press TAB to insert.
2) TAB-key functionality.
Try highlighting a database in Object Browser and type in a single or a few characters in the editor pane. For each time you press the TAB key autocomplete will switch between all possible inputs starting with this/these character(s). These inputs are functions, keywords and database objects from the selected database as well.
3) CTRL+ENTER functionality.
As above type in a single or a few character(s) in the editor pane. Press CTRL+ENTER and a small window opens with a list of keywords and functions starting with this/these character(s). Cursor must be placed in editor window. Use arrow-keys to select one, press ENTER and the selected one is inserted.
4) CTRL+SPACE functionality.
When cursor is placed in the editor pane pressing CTRL+SPACE always opens a small window with a list of ALL keywords and functions. As above use arrow-keys to select one, press ENTER and the selected one is inserted.
5) CTRL+SHIFT+SPACE functionality.
Ctrl+Shift+Space keyboard shortcut that will display the parameter-list of a routine when the cursor is positioned inside it. While writing a routine call the parameter list will highlight the current parameter.
ALSO NOTE: From version 6.5 Autocomplete supports table aliases and column aliases. Try this by typing,
"SELECT `somecol` as ourcol from `sometable` as mytab where mytab.somecol Groupby our"
... and now you will see that all Autocomplete functionalities identify 'mytab' as a valid table name and 'ourcol' as a valid column name (for that statement) matching the substring for the table/alias "my" and column/alias name "our".
Autocomplete supports both table-alias'es and column-alias'es in SELECT, UPDATE and DELETE statements with the current exceptions, where it is still not supported:
-- SELECT statement used to specify an value for INSERT (like "INSERT INTO mytab (col1) values ((SELECT ...))")
-- SELECT statement used as argument to a function (like "SELECT IF((SELECT ....),'true','false')")
- Table Alias:
- Column Alias:
Note:This feature is available in SQLyog Professional, Enterprise and Ultimate.