Documentation Home
MySQL Shell for VS Code


Pre-General Availability: 2024-05-02

4.5 Work with Result Sets

When you execute SQL queries from a notebook or script editor, the resulting records are shown in the output area. The notebook editor's output area is part of the code block where the query was issued. The script editor opens a separate output area below the script. In both cases, tabs are used to separate the result sets if more than one is generated.

Expand or reduce result area

To expand or reduce the output area, use your pointer device to hover over the separation zone above or below a code block (notebook editor) or the zone between the script and output area. The separation zone displays a thick line when it becomes active.

Figure 4.5 MySQL Shell for VS Code - Notebook Result Set Copy

Content is described in the surrounding text.

Manage records with the result toolbar

When a query generates and shows records in the output area, with or without tabs, the editor also includes a result toolbar for quick actions. If tabs are present, the actions apply to the result set within the tab.

Figure 4.6 MySQL Shell for VS Code - DB Notebook Toolbar

Content is described in the surrounding text.

Result tools from left to right:

  • Query result status, such as OK or an error message, and the number of records retrieved by page (1000 records on each page).

  • Previous page and next page (active for large result sets only)

  • Maximize result set view

  • Result-set format (tabular by default)

  • Show Action Menu: Export result set, Import result set

Copy rows and fields

Several copy actions are available at the field, row, and rows level. After your query result set is shown in the output area, you can right-click the data to copy the output using one or more of the copy actions.

For example, the following query of the world database sample returns several rows. If you right-click the NLD value in the CountryCode column, you can select various copy actions based on the selected field.

SELECT * FROM countrylanguage where Language like 'Dutch'

Figure 4.7 MySQL Shell for VS Code - Notebook Result Set Copy

Content is described in the surrounding text.

Copy actions are:

  • Copy Row

    'NLD', 'Dutch', 'T', '95.6'

  • Copy Row With Names

    # CountryCode, Language, IsOfficial, Percentage
    'NLD', 'Dutch', 'T', '95.6'

  • Copy Row Unquoted

    NLD, Dutch, T, 95.6

  • Copy Row With Names, Unquoted

    # CountryCode, Language, IsOfficial, Percentage
    NLD, Dutch, T, 95.6

  • Copy Row With Names, Tab Separated

    # CountryCode,   Language,   IsOfficial,   Percentage
    'NLD',   'Dutch',   'T',   '95.6'

  • Copy Row Tab Separated

    'NLD', 'Dutch', 'T', '95.6'

  • Copy Field

    'NLD'

  • Copy Field Unquoted

    NLD