Prior to running SQL commands, you may want to check and, if necessary, change the SQL dialect to be used.

When typing the SQL commands in the Input pane of the Database Console tool window (this pane opens as a new editor tab), use various kinds of coding assistance, such as code-specific completion, syntax and error highlighting, completion of the data source, table and column names. You may also be interested in using the following features:

Run the command when ready.

As you run the SQL statements, PyCharm memorizes them. So, at a later time, you can view the statements you have already run and, if necessary, run them again.

There are two ways of working with the history of executed SQL statements. You can:

Note that:

  • There is a separate history of executed statements for each of your data sources.
  • The number of executed SQL statements to be memorized may be changed by editing the value of Console commands history size in the Editor page of the IDE Settings.
  • The history files that haven't been used for two weeks are automatically deleted. That is, if you haven't run SQL statements for a certain data source within this time, the corresponding history is discarded.
  1. Open the Database Console for the data source of interest.
  2. Click the Properties button properties.gif on the toolbar.
  3. In the Database Console Properties dialog that opens, select the General tab.
  4. Select the desired dialect from the SQL Dialect list and click OK.

When typing an SQL statement, you can view parameter information on-the-fly or by pressing Ctrl+P. PyCharm informs you about the type of required parameters in a tooltip.

sqlConsoleParameterInfoTooltip.png

See Also

Procedures:

Language and Framework-Specific Guidelines:

Reference:

Web Resources: