When typing an SQL statement, you can view parameter information on-the-fly or by pressing Ctrl+PCtrl+PCtrl+PShift+Alt+PCtrl+Shift+SpaceCtrl+PCtrl+PMeta PMeta P. 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 Ctrl+B, Ctrl+Button1 Click or Ctrl+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 F12, Shift+F2, , 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 F3 or . The corresponding table and column are highlighted in the data source for which the console was launched.
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 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+EShift+F4Ctrl+EMeta EMeta E.
In this dialog, you can:
- Navigate through the list of the executed statements using the UpUpUpUpUp or Ctrl+PUpUpUpUpUpUp or Control P and DownDownDownDown 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 DeleteDeleteDeleteDelete or Ctrl+DDeleteDeleteDeleteDeleteDeleteDelete 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 EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter.
- Select the statement and click OK.
As a result, the history dialog closes and the selected statement is copied to the Input pane.