When typing an SQL statement, you can view parameter information on-the-fly or by pressing Ctrl+PCtrl+PCtrl+PCtrl+PShift+Alt+PCtrl+PCtrl+Shift+SpaceCtrl+PCtrl+PMeta PMeta PControl Shift Space. IntelliJ IDEA informs you about the type of required parameters in a tooltip.
You can use parameters in SQL statements and specify which values should be used in place of these parameters when running the statements:
- When typing a command, enclose the parameters in #, $, or ? characters.
In the Parameters pane, specify the values to substitute for the
corresponding parameters at command execution.
Do one of the following:
- Place the caret at the desired name and press Ctrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+Alt+G, Escape, Period, Alt+Period or Ctrl+Button1 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickF12, Shift+F2, Ctrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickF3 or Ctrl+Button1 ClickMeta B, Meta Button1 Click or Button2 ClickMeta B, Meta Button1 Click or Button2 ClickF3 or Control Button1 Click. The corresponding table and column are highlighted in the data source for which the console was launched.
With the Ctrl key pressed, hover the mouse pointer over
the reference to a table or column.
So doing, the corresponding table or column declaration is displayed in a tooltip, and the
reference turns to a hyperlink.
Click the link to jump to the declaration in the data source.
You can run the SQL statements one at a time, or execute a number of statements that follow one another in the console at once:
- To execute a command at the caret, press Ctrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterMeta EnterMeta EnterMeta Enter or click on the toolbar.
To run several consecutive commands, select them in the console. Then, press Ctrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterCtrl+EnterMeta EnterMeta EnterMeta Enter or click
on the toolbar.
You can prepare a script in an SQL file, copy and then paste its contents into the Input pane.
When working with the Input pane of the Database Console tool window, you can browse the executed SQL statements one by one by moving to the previous or next statement:
- To navigate to the previous statement, press Ctrl+UpCtrl+UpCtrl+UpCtrl+UpCtrl+UpCtrl+UpCtrl+UpCtrl+UpCtrl+UpMeta UpMeta UpMeta Up.
- To navigate to the next statement, press Ctrl+DownCtrl+DownCtrl+DownCtrl+DownCtrl+DownCtrl+DownCtrl+DownCtrl+DownCtrl+DownMeta DownMeta DownMeta Down.
When working with the Input pane of the Database Console tool window, you can open the history dialog to see the executed SQL statements all at once.
To open this dialog:
- Press Ctrl+ECtrl+ECtrl+ECtrl+ECtrl+ECtrl+ECtrl+EShift+F4Ctrl+EMeta EMeta EMeta E.
In this dialog, you can:
- Navigate through the list of the executed statements using the UpUpUpUpUp or Ctrl+PUpUpUpUpUpUpUp or Control P and DownDownDownDownDown or Ctrl+NDownDownDownDownDownDownDown or Control N arrow keys.
- Remove the statements from the history. To delete a statement, select (navigate to) the statement to be deleted and press DeleteDeleteDeleteDeleteDelete or Ctrl+DDeleteDeleteDeleteDeleteDeleteDeleteDelete or Backspace.
Copy the statements to the Input pane. To copy a statement, do
one of the following:
- Double-click the statement to be copied.
- Select (navigate to) the statement of interest and press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter.
- Select the statement and click OK.
As a result, the history dialog closes and the selected statement is copied to the Input pane.