Skip to main content

Use auto-complete, formatting, and search

Auto-complete fills in keywords and object names for you, so you type less and avoid wrong table names. Formatting and search help you read and change long SQL.

Prerequisites​

Complete keywords​

  1. Type the first letters of a keyword, for example SEL.
  2. Press Tab or Enter to accept SELECT.

Use the arrow keys to move through the list. Press Esc to close it.

Complete table names​

  1. Type FROM or JOIN followed by a space.
  2. Select a table from the list.

The list shows tables in the catalog.schema.table form. It only shows tables you have access to.

Table suggestions after the FROM keyword

Complete column names​

  1. Type a table name or table alias followed by a dot, for example orders..
  2. Select a column from the list.

The list shows each column name and, when available, its data type. If Query Editor cannot match the alias to a table, it shows no suggestions, and you can keep typing.

note

If you see Autocomplete is unavailable., you can still type SQL and run it. Suggestions come back when the service recovers.

Format SQL​

  1. Select the SQL you want to format.
  2. Right-click the selection.
  3. Select Format SQL.

You can also press Ctrl+Shift+F instead of steps 2 and 3. Query Editor rewrites the SQL with consistent line breaks and indentation. If the SQL cannot be read, the text stays the same and you see Unable to format SQL.

Right-click menu on selected SQL with the Format SQL option

Find and replace text​

  1. Press Ctrl+F to open the search box in the editor.
  2. Type the text to find. Every match is highlighted.
  3. To replace, type the new text in the replace field and confirm.

Replacing text only changes the editor. It does not run the query.

Keyboard shortcuts​

ShortcutAction
Ctrl+EnterRun the statement at the cursor or the selection.
Ctrl+Shift+FFormat SQL.
Ctrl+FFind and replace.
Tab or EnterAccept a suggestion.
EscClose the suggestion list.

Next steps​