Procedure Overview

What is Procedure in SAP HANA?

A procedure is a unit/module that performs a particular task.
  • Procedures are reusable processing blocks, and describe a sequence of data transformations
  • Procedures can have multiple input and output parameters (scalar or table types)
  • DROP and CREATE statements are used to modify the definition of a procedure
  • A procedure can be created as read only (without side-effects) or read-write (with side-effects)
Few more facts on procedure:
  • The body of a procedure consists of a sequence of statements separated by semicolons
  • An intermediate variable, inside a procedure, is not required to be defined before it is bound by an assignment
  • A variable name is prefixed by ':' while used as input to another statement
  • Cyclic dependencies that result from the intermediate result assignments or from calling other functions are not allowed
  • A Procedure can be created using the SQL editor or using creation wizards available for the different perspectives in the SAP HANA Studio (Modeler and Development perspectives)
Different ways to create a procedure:

There are 3 ways to create a procedure in HANA.
  1. Using the SQL editor
  2. Using the Modeler wizard in Modeler perspective
  3. Using SAP HANA –XS project in “SAP HANA Development” perspective
In later chapters we learn about each of these approaches.

Note: Do not get confused by the questions like - why so many ways to create procedure? Which is one should I use? Which one is better? We will explain these later. Right now let us just learn each of these approaches.

Click here to go to Next Chapter. 5.2. Prerequisites for Creating Procedure

No comments:

Post a Comment