I would like to create a function within a function in native SAP HANA SQL
CREATE or REPLACE FUNCTION my_func (pi_param VARCHAR(1)) RETURNS v_return varchar(10) AS
BEGIN
DECLARE ….;
DECLARE ….;
FUNCTION my_local_func (pi_param INTEGER) RETURNS v_return INTEGER AS
BEGIN
…
…
END;
END;
In Oracle PL/SQL I simply would declare my_local_func as well as local needed variable between “AS” and “BEGIN” of the my_func definition. This doesn’t work in SAP HANA. Nor it doesn’t work after the “BEGIN” section either (as stated here in this example).
So my question is, how to define a function within a function in native HANA SQL.