Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 84 additions & 30 deletions tutorials/hana-cloud-sqltools-console/hana-cloud-sqltools-console.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check warning on line 1 in tutorials/hana-cloud-sqltools-console/hana-cloud-sqltools-console.md

View workflow job for this annotation

GitHub Actions / checks / checks

content/body-no-steps

No step headings found (expected at least one '## ' heading that is not 'You will learn' or 'Prerequisites')
parser: v2
auto_validation: true
time: 15
Expand Down Expand Up @@ -149,28 +149,8 @@
![Statement help panel](statement-help.png)

Notice that for SAP HANA Cloud, SAP HANA databases, links to the related documentation and details on the objects used in the SQL statement are shown including a link which will open the database objects app where additional details of the object can be viewed.

<!-- FEATURE UNRELEASED


4. Query results can also be displayed as a chart. After executing a query, select the **Visualize Data** tab in the results panel to switch to a graphical view. Execute the following SQL statements to try it out.

```SQL
SELECT TOP 7
COUNT(*) AS NUM_OF_TABLES, SCHEMA_NAME
FROM M_TABLES WHERE SCHEMA_NAME != 'SYS'
GROUP BY SCHEMA_NAME ORDER BY NUM_OF_TABLES DESC;
```

![Visualize Data](visualize-data.png)

Choose a chart type such as bar, horizontal bar, line, pie, donut, or scatter, and configure the axes to visualize the data.

![Data Graphs](data-graphs.png)

-->

5. Commonly used shortcut keys are listed below. Try a few of them out.
4. Commonly used shortcut keys are listed below. Try a few of them out.

Action | Shortcut
------ | ------
Expand All @@ -193,17 +173,83 @@

For the complete list see [Common Keyboard Shortcuts for the SQL Console](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-administration-guide/keyboard-shortcuts-for-sql-console).

6. Examine the **History** tab.
5. Examine the **History** tab.

![History tab](messages-history-tab.png)

Notice details for each executed statement are displayed, including metrics such as memory consumption. Statements can be quickly located using the search functionality. Selected statements may be inserted back into the SQL console or copied for further use.

The columns can also be changed by selecting the gear icon in the right corner.

![History tab columns](history-tab-columns.png)
![History tab columns](fixed-width-font-setting.png)

The Column Settings dialog also includes a Fixed-Width Font option for the results view. Enabling a fixed-width (monospace) font can improve alignment and readability when reviewing query results or structured data.

6. Execute the following SQL to illustrate the Fixed-Width Font feature.

```SQL
SELECT
'┌────┬──────────┬──────────┐' || CHAR(10) ||
'│ ID │ NAME │ CITY │' || CHAR(10) ||
'├────┼──────────┼──────────┤' || CHAR(10) ||
'│ 1 │ Shadida │ Waterloo │' || CHAR(10) ||
'│ 2 │ Dan │ Victoria │' || CHAR(10) ||
'│ 3 │ Jose │ Toronto │' || CHAR(10) ||
'└────┴──────────┴──────────┘'
AS RAW_TEXT
FROM DUMMY;
```

With Fixed-Width Font disabled, double-click the result to open the results as raw text. Notice how the text does not appear to be aligned when displayed using a proportional font.

![Fixed-Width Font disabled](fixed-width-font-disabled.png)

Now, select the gear icon and enable Fixed-Width Font. After confirming the setting, open the raw text view again. With Fixed-Width Font enabled, each character occupies a consistent width, making formatted text and structured output easier to read.

![Fixed-Width Font enabled](fixed-width-font-enabled.png)

7. The SQL Console can display query results as charts directly within the results pane.

Execute the following SQL to illustrate the query visualization feature.

7. Examine the **SQL Console Settings**.
```SQL
SELECT CITY,
COUNT(*) AS HOTEL_COUNT
FROM HOTEL
GROUP BY CITY
ORDER BY HOTEL_COUNT DESC;
```

The data visualization tab can be opened by selecting the chart icon in the right corner.

![Open data visualizer](visualize-data-before.png)

To configure the graph:
- Choose Bar Chart.
- Configure CITY as Label Axis and HOTEL_COUNT as Value Axis.

This provides a quick visual summary of the number of hotels in each city without leaving the SQL Console.

![Configure data visualizer](visualize-data-after.png)

8. The SQL Console can display the SQL statement associated with a selected result tab.

Execute the following SQL statements to illustrate the statement result indicator feature.

```SQL
SELECT * FROM HOTEL;
SELECT * FROM ROOM;
SELECT CITY,
COUNT(*) AS HOTEL_COUNT
FROM HOTEL
GROUP BY CITY;
```

Note that multiple result tabs are created, one for each query that returns a result set. The associated SQL statement for a selected results tab can be displayed by selecting the SQL toggle in the results pane.

![SQL statement indicator](visual-indicator-results.png)

9. Examine the **SQL Console Settings**.

![Connection settings](connection-settings.png)

Expand Down Expand Up @@ -232,7 +278,15 @@

![Result behavior settings](result-behavior.png)

8. Execute the following SQL which is used to illustrate the result display settings.
When enabled, selecting a results tab automatically highlights the corresponding SQL statement in the editor, making it easier to trace results back to their source without manual searching. This setting enhances the SQL statement indicator feature by linking result tabs directly to their corresponding SQL statements.

![SQL source statement setting](show-source-sql-setting.png)

To illustrate this, enable the setting, save the configuration, and select the second result tab. The SQL associated with this result tab will be highlighted in the console as shown below.

![SQL source statement demo](show-source-sql-demo.png)

10. Execute the following SQL which is used to illustrate the result display settings.

```SQL
SELECT CURRENT_DATE, CURRENT_TIMESTAMP(7), RAND() * 10 FROM DUMMY;
Expand All @@ -250,11 +304,11 @@

![Result formatted](formatted.png)

9. The overall theme for SAP HANA Cloud Central can be set in the settings which also affects the theme of the SQL console.
11. The overall theme for SAP HANA Cloud Central can be set in the settings which also affects the theme of the SQL console.

![Theme](theme.png)

10. Execute the following SQL statements.
12. Execute the following SQL statements.

```SQL
SELECT HEXTOBIN ('48656C6C6F20776F726C64') BINARY_EXAMPLE FROM DUMMY;
Expand Down Expand Up @@ -303,11 +357,11 @@

![SQL results](result-viewer.png)

11. The Auto-save contents of SQL consoles setting can be used to persist the open SQL console tabs and their contents. This setting is on by default.
13. The Auto-save contents of SQL consoles setting can be used to persist the open SQL console tabs and their contents. This setting is on by default.

![Auto save](auto-save.png)

12. SQL statements can also be executed in the background. This allows users to start a long-running statement, disconnect, and return later to view the results.
14. SQL statements can also be executed in the background. This allows users to start a long-running statement, disconnect, and return later to view the results.

Execute the following statement by clicking the Run dropdown menu and selecting Run Statement in Background:

Expand All @@ -325,7 +379,7 @@

The results will appear in the Background Statements tab at the bottom on the console.

13. The actions menu for a SQL console tab offers additional options such as the ability to rename a tab, to move a tab, to open a previously closed tab, or to search through the content of all open SQL console tabs.
15. The actions menu for a SQL console tab offers additional options such as the ability to rename a tab, to move a tab, to open a previously closed tab, or to search through the content of all open SQL console tabs.

![SQL console actions menu](actions-menu.png)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading