You can open multiple SQL Terminal tabs in Data Studio to execute multiple SQL statements for query in the current SQL Terminal tab. Perform the following steps to open a new SQL Terminal tab:
You can also open multiple SQL Terminal tabs on different connection templates.
The SQL Terminal tab is displayed.
Data Studio displays an error message indicating that no result is found in the status bar. The Result tab displays the successful execution results.
Perform the following steps to open a new SQL Terminal tab in another connection:
The name format of the new SQL Terminal tab is as follows:
Database name@Connection information(Tab number), for example, postgres@IDG_1(2). The number of each SQL Terminal tab in the same connection information is unique.
You can copy or export cell data to an Excel file and generate a SQL query file.
After the SQL query result is displayed in the Result tab, right-click the result. The following menu is displayed:
Perform the following steps to add a row number and column header to the result set:
The following table describes the right-click options.
Option |
Sub-Item |
Description |
---|---|---|
Copy Data |
Copy |
Copies data in the selected cell. |
Advanced Copy |
Copies data in the selected cell, row number, and column header based on the preference settings. |
|
Copy to Excel |
Copy as xls |
Exports data of selected cells to an xls file, which contains a maximum of 64,000 rows and 256 columns. |
Copy as xlsx |
Exports data of selected cells to an xlsx file, which contains a maximum of 1 million rows. |
|
Export |
Current Page |
Exports the table data on the current page. |
All Pages |
Exports all tables. |
|
Generate SQL |
Selected Line |
Selects data from the target table of the statement for inserting data to generate a SQL file. |
Current Page |
Selects data of the current page from the target table of the statement for inserting data to generate a SQL file. |
|
All Pages |
Selects all table data from the target table of the statement for inserting data to generate a SQL file. |
|
Set Null |
- |
Sets the cell data to null. |
Search |
- |
Searches for data in the selected cell and displays all data that meets the search criteria. |
The preceding SQL files do not take effect for the result sets generated by queries that use JOIN, expressions, views, SET operators, aggregate functions, GROUP BY clauses, or column aliases.
When a query is executed in the SQL Terminal pane, a progress bar is displayed to dynamically display the execution duration. After the query is complete, the time bar disappears. The total execution duration is displayed next to the time bar.
If you want to cancel the query, click Cancel next to the time bar.
The procedure is shown in the following figure.