Using the SQL Console

Objectives

After completing this lesson, you will be able to:

  • Use the SQL console

Using the SQL Console and Database Explorer

Creating Tables in SAP HANA

To load data into the SAP HANA database, you need to create tables. By default tables are kept in the column storage, but in some limited number of use cases the row-store is the better location.

Tables can be created using SQL in the SAP HANA database explorer – SQL Console or using command hdbsql on the command line. Before you can create a table, you must have the CREATE ANY permission in the schema where you want to create the table.

In the above example, the SQL statement creates a column table named EPM.PO.Item_Part_DEMO in the schema HA200_DEMO. This new table is the exact copy including data from the sap.hana.democontent.epm.data::PO.Item table. The CREATE TABLE ... LIKE ... with data syntax combines the individual CREATE TABLE and INSERT INTO statements into a single command.

Manually Loading and Unloading Column Tables

Under normal circumstances, the SAP HANA database manages the loading and unloading of tables into and from memory independently – the aim being to keep all relevant data in memory. However, you can manually load and unload individual tables and table columns if necessary.

Because the SAP HANA database manages the loading and unloading of tables automatically, you do not have to interfere with this process. However, if necessary, you can load and unload individual tables and table columns manually. For example, this occurs in the following cases:

  • To measure, precisely, the total memory, or the amount of memory used by a particular table (load)

  • To actively free up memory (unload)

Log in to track your progress & complete quizzes