User Defined Functions in SAP HANA

User Define Function in SAP HANA:-

User Defined Functions in SAP HANA are the read only function that means we can not perform any DDL and DML(insert update and delete) operation inside the body of the function.There is two type of user-defined functions: Scalar User Defined Functions and Table User Defined Functions.

There are two types of user define the function in sap hana.
1-Table User Define Function (Table UDF)
2-Scalar User Define Function(Scalar UDF)
These categories are defined on the basis of input/Output parameter, supported functionality in the body of the function and how they are going to consume in the SQL statement.

1-Table User Define Function:[AdSense-A]
Table User Define Function always returns a table and its parameter may also be off table type.

Syntax:

 

Example:

 

Calling of the function:[AdSense-A]

 

2-Scalar User Define Function:
Scalar User Define Function does not support table type variable as its input and table operations in the function body.

Syntax: