Skip to Content

Browse Schema with the Database Browser in SAP HANA Database Explorer

test
0 %
Browse Schema with the Database Browser in SAP HANA Database Explorer
Details

Browse Schema with the Database Browser in SAP HANA Database Explorer

October 28, 2020
Created by
October 20, 2020
See how the database browser can be used to explore and examine objects in an SAP HANA database.

You will learn

  • How a schema filter can be used in the database browser
  • How to explore and examine objects in an SAP HANA database

Prerequisites

  • An SAP HANA database such as SAP HANA Cloud trial or the SAP HANA, express edition that includes the SAP HANA database explorer
  • You have completed the first 3 tutorials in this group


Step 1: Schemas
  1. Many objects within an SAP HANA database belong to a schema. A schema allows objects, like tables, views, functions, and stored procedures, to be grouped together. The current schema in the SQL console is shown at the top of the SQL console.

    Current Schema

    The schema can be changed by executing the SQL statement below:

    SET SCHEMA HOTEL;
    

    When performing a select against an object in the currently-set schema, the schema name can be omitted.

    SET SCHEMA USER1;
    SELECT * FROM HOTEL.CITY;  --succeeds
    SELECT * FROM CITY;  --fails
    SET SCHEMA HOTEL;
    SELECT * FROM CITY; --succeeds
    
  2. When browsing objects in the database browser, the schema name is shown for each object if a schema filter is not set.

    schemas

    A schema filter can be applied.

    Schemas In Catalog Tree

    The schema filter persists between reloads of the SAP HANA database explorer.

Log on to answer question
Step 2: Table editor
  1. Right-click Tables in the catalog tree and choose Show Tables.

    Show Tables

    A list of all of the tables appears along with additional metadata.

    All Tables
  2. Filters can be applied to the columns. The filter is applied to the data that is already fetched.

    column filter
  3. The set of columns to be displayed can be set.

    select columns to show
  4. Right-click the name of a table in the tree and select Open. The editor for the table opens in a new tab.

    Table Details
  5. Examine the other tabs, such as Runtime Information, where further information about the table can be found. This information includes the total number of rows, disk size, and memory consumption for the table, as well as individual columns.

    Table Runtime Information
  6. Click the button Open Data. The table’s rows are shown.

    Table Editor
  7. Rows can be edited by selecting a cell and typing in a new value. New rows can be added by selecting the + button. Changes must be saved by pressing the save button in order to commit them to the table.

    Add Row To Table
  8. The results can be saved to a comma-separated values (CSV) file.

    Download table
  9. Filters can be applied to the table using a set of dropdowns that build up a WHERE clause, which can select a subset of the data.

    Table filter button

    The following filter searches for hotels in California with a name containing lo.

    Create And Apply Filters

    Select the SQL button to see the generated query.

    SQL Query
Log on to answer question
Step 3: Additional features
  1. Right-click the tab of an open object such as CITY and choose Display In Database Browser to reveal the object in the database browser.

    Display In Database Browser

    The database browser then updates to display the selected object.

    Object Displayed In Catalog
  2. A list of objects that make use of a selected object can be found using the Where-Used Browser or in more recent versions Find Dependencies menu item.

    Right-click the ROOM table and choose Where-Used Browser.

    where used browser

    As seen in the screenshot below, the ROOM table is used by the AVERAGE_PRICE function and the HOTEL_ROOMS_VIEW.

    where used browser
  3. The SAP HANA database explorer has the ability to search for an object in one or more databases.

    Click the magnifying glass in the top right.

    Enter hotel in the search field.

    Select the database to search against.

    Select Function, View, Procedure, and Schema names.

    Global Search

    The above search returned a function, view, stored procedure, and another view.

Congratulations! You have now used the database browser to view details of objects within an SAP HANA database and have become familiar with some of the features it provides.

Which of the following statements are true?
×

Next Steps

Back to top