Lesson: Understanding Core Modeling With SAP HANA

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Lesson: Understanding Core Modeling with SAP HANA

Figure 52: Table Functions

In SAP HANA modeling, table functions are typically used to generate a tabular data set that
is used as a data source in a calculation view. Table functions can be used in SQLScript in a
from clause of a select statement (in other words wherever a standard table identifier is
used). A table function encapsulates the logic in a reusable form so that it can be used many
times in different artifacts.
Table functions can accept one or more input parameters. Table functions are read-only; that
is, they cannot be used to change data. Table functions produce exactly only one tabular
output. Table functions can also call other functions.

Add SQL to Models Using Procedures


Procedures define reusable data processing logic that can be used to enhance a calculation
view. Procedures are very similar to functions in that they are written in SQLScript and can
have one or more inputs and they always have outputs. However, procedures can produce
multiple output data sets of different structures, whereas a table function can only return one
tabular output structure. Procedures cannot be used as data sources to calculation views.
They are used in various places in a calculation view, especially where some processing logic
is required, for example, to automatically derive values for an input parameter, or to return
values used in analytic privileges where the rules are too complex to be defined using the
graphical editor.

© Copyright. All rights reserved. 75

You might also like