Skip to Content
0
Jan 19, 2021 at 03:14 PM

Nested Procedure in SAP HANA

101 Views

In plsql you can create nested procedures, as in the example.

create or replace procedure mytable (
    Ptable_name in varchar2
  , Pemp_name in varchar2
  , Pemp_age in number
     ) is

  procedure myvalues (
       Pemp_name in varchar2
     , Pemp_age in number
       ) is
  begin
     execute immediate 'insert into ' || Ptable_name
                    || ' values (:emp_name, :emp_age)'
       using Pemp_name, Pemp_age;
  end;

begin

   execute immediate 'create table ' || Ptable_name
                      || ' (sname varchar2(20), sage number (4))';

   myvalues ( Pemp_name, Pemp_age);

end;

Would it be possible to create nested procedures using SQL Script in SAP HANAl?