PyCharm 3.0.1 Web Help

Some features described here are available in Professional edition only.

You can add, remove and modify table records by running SQL statements in the Database console or in the editor. You can also edit the records retrieved from tables in the Results pane.

Besides these facilities, PyCharm also features the Table Editor which provides a graphical interface for manipulating table data.

Note

The Table Editor is available only for DB data sources.

Opening a table in the table editor
  • In the Database tool window, do one of the following:
    • Click the table of interest and click DataTables on the toolbar (if the toolbar is not currently hidden).
    • Select the table and press F4F4F4F4F4F4F4F12 or Ctrl+Shift+ECommand Down or F4F4F3.
    • Right-click the table and select Table Editor from the context menu.

As a result, the table opens in the Table Editor on a separate editor tab.

Navigating through subsets of rows

If only a subset of all the rows is currently shown, to switch between the subsets, use:

  • dataSourceTableEditorFirstPage First Page
  • dataSourceTableEditorPreviousPage Previous Page (Ctrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpAlt Command UpAlt Command UpAlt Command Up)
  • dataSourceTableEditorNextPage Next Page (Ctrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownAlt Command DownAlt Command DownAlt Command Down)
  • dataSourceTableEditorLastPage Last Page
Making all rows visible simultaneously

If you want all the rows to be shown simultaneously:

  1. Click settings on the toolbar of the Table Editor.
  2. In the Database dialog that opens, specify 0 in the Result set page size field, and click OK.
  3. Click refresh or press Ctrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RConsole.TableResult.ReloadCommand RConsole.TableResult.Reload to refresh the table view.
Navigating to a specified row

To switch to a row with a specified number:

  1. Do one of the following:
    • Press Ctrl+GCtrl+GCtrl+GCtrl+GAlt+GCtrl+GCtrl+GCtrl+LCommand LCommand GCommand L.
    • Right-click the table, and select Go To | Row from the context menu.
    • Select Navigate | Row from the main menu.
  2. In the dialog that opens, specify the row number and click OK.
Sorting data

You can sort table data by any of the columns by clicking the cells in the header row.

Each cell in this row has a sorting marker in the right-hand part and, initially, a cell may look something like this: TableEditorHeaderCellUnsorted. The sorting marker in this case indicates that the data is not sorted by this column.

If you click the cell once, the data is sorted by the corresponding column in the ascending order. This is indicated by the sorting marker appearance: TableEditorHeaderCellSortAsc. The number to the right of the marker (1 on the picture) is the sorting level. (You can sort by more than one column. In such cases, different columns will have different sorting levels.)

When you click the cell for the second time, the data is sorted in the descending order. Here is how the sorting marker indicates this order: TableEditorHeaderCellSortDesc.

Finally, when you click the cell for the third time, the initial state is resorted. That is, sorting by the corresponding column is canceled: TableEditorHeaderCellUnsorted.

Filtering data
  1. If the filter box is not currently shown, click ShowFilter on the toolbar.
  2. In the filter box, specify filtering conditions.

    The filtering conditions are specified as in a WHERE clause but without the word WHERE, e. g. name like '%y%' and relation <> 'sister'. Within the like expressions, the SQL wildcards can be used: the percent sign (%) for zero or more characters and underscore (_) for a single character.

    TableEditorFilteredTable

    Use:

    • EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter to apply the conditions currently specified in the box.
    • find1 to open the list of all the conditions that you have used. Select the condition in the list to apply it again.

      TableEditorFilterHistory

    • clear to clear the box and restore the initial table view (i.e. when no filtering is applied). When the box is empty, clicking this button hides the box.
    • EscapeEscapeEscapeEscapeEscape, Escape or Ctrl+GEscapeEscapeEscapeEscapeEscapeEscape to restore the initial (unfiltered) table view and hide the box.
Reordering columns

To reorder columns, use drag-and-drop for the corresponding cells in the header row.

TableEditorReorderColumns

Editing fields and uploading files
  1. To start editing a field, double-click the corresponding table cell.
  2. Edit the cell contents. To do that, you have the following options:
    • Modify the data right in the cell. To save the changes, press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter.
    • Click browseButton.png or press Shift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift EnterShift EnterShift Enter to open the Enter text data or choose file dialog. In this dialog you can:
      • Make the necessary edits in the upper area.
      • Upload a file into the field. To do that, click Browse and select the desired file in the Choose Path dialog.
      • Insert null into the field (click Null).
  3. To leave the editing mode, click a different cell or press EscapeEscapeEscapeEscapeEscape, Escape or Ctrl+GEscapeEscapeEscapeEscapeEscapeEscape.
Adding a record to a table
  1. Do one of the following:
    • Press Alt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+Insert or Ctrl+NAlt+InsertCommand N or Control EnterControl N or Control EnterCommand N or Control Enter.
    • Click add.png Add New Row on the toolbar of the Table Editor.
    • Select Add New Row from the context menu.
  2. Fill in the fields. Use the EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter or the TabTabTabTabTabTabTabTabTabTabTab key to indicate the end of your input in the current cell and move on to the next cell. The new record is saved when you press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter or TabTabTabTabTabTabTabTabTabTabTab in the last of the cells.
Deleting records
  1. Select the row or rows that you want to delete. To do that:
    • If you are going to delete one row, select any of the cells within the corresponding row.
    • If you are going to delete a range of rows, select one or more cells in each of the corresponding rows.

      Note

      You can select only the rows that follow one another.

  2. Do one of the following:
    • Press Ctrl+YCtrl+YCtrl+YCtrl+YCtrl+YCtrl+Shift+LCtrl+ECtrl+DCommand BackspaceCommand YCommand D.
    • Click delete.png Delete Selected Rows on the toolbar of the Table Editor.
    • Select Delete Selected Rows from the context menu.
  3. Confirm your intention to delete the selected row or rows by clicking OK in the corresponding dialog.
Saving large objects (lobs) in files

You can save large objects (LOBs) stored in database tables in local files. To do that:

  1. Select the cell containing the large object of interest.
  2. Do one of the following:
    • Click mainToolbarSave.gif Save LOB As on the toolbar of the Table Editor.
    • Select Save LOB As from the context menu.
  3. In the Select File to Save dialog:
    1. Specify the destination directory in the upper part.
    2. Type the name of the file File name field.
    3. Click OK.
Refreshing a table view

You may want to refresh the view of a table in the Table Editor in order to:

  • Synchronize the data shown with the actual contents of the table in the database.
  • Apply the changed page size setting to the current table view.

In all such cases, use the Reload Page command:

  • Press Ctrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RConsole.TableResult.ReloadCommand RConsole.TableResult.Reload.
  • Click refresh.png Reload Page on the toolbar of the Table Editor.
  • Select Reload Page from the context menu.

See Also

Language and Framework-Specific Guidelines:

Reference:

Web Resources: