Data Studio allows viewing and managing frequently executed SQL queries. The history of executed SQL queries is saved only in SQL Terminal.
Perform the following steps to view the history of executed SQL queries:
The SQL History dialog box is displayed.
The scripts of historical SQL queries are not encrypted.
The number of queries displayed in the SQL History dialog box depends on the value set in Preferences > Editor > SQL History. For details about setting the value, see SQL History. Data Studio overwrites the older queries into the SQL history after the list is full. The executed queries are automatically stored in the list.
The SQL History dialog box contains the following columns:
The connection information is deleted together with the query history. If the SQL History dialog box is closed, the query is not removed from the list.
You can perform the following operations in the SQL History dialog box:
Perform the following steps to load a SQL query into the SQL Terminal pane:
The query is added to the cursor position in SQL Terminal.
You can click the Load in SQL Terminal and close History button to load selected queries into SQL Terminal and close the SQL History dialog box.
Perform the following steps to load multiple selected SQL queries into the SQL Terminal pane:
The queries are added to the cursor position in SQL Terminal.
If you continue the execution upon an error, each statement in SQL Terminal will be executed in sequence as a scheduled job. The execution status is updated in the console and each job is listed in the progress bar. When the time difference between Job Execution, Progress Bar Update and Console Update is small, you will not be able to stop the execution by opening the progress bar. In this case, you need to close SQL Terminal to stop the execution.
To load more data in the Result tab, you need to scroll down to bottom, which is inconvenient in some scenarios. Data Studio provides a button that simplifies the loading operation.
Perform the following steps to load more records:
All the required records are listed.
Perform the following steps to delete a SQL query from the SQL History list:
A confirmation dialog box is displayed.
Perform the following steps to delete all SQL queries from the SQL History list:
A confirmation dialog box is displayed.
You can pin queries that you do not want Data Studio to delete automatically from SQL History. You can pin a maximum of 50 queries. Pinned queries are displayed at the top of the list. The value set in SQL History does not affect the pinned queries. For details, see SQL History.
The pinned queries are displayed at the top of the list once the SQL History pane is closed and opened again.
Perform the following steps to pin a SQL query:
The Pin Status column displays the pinned status of the query.