Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

EXEC and EXECUTE IMMEDIATE in HANA

Hi Experts,

I am trying to insert some data into table using exec or execute immediate in procedures, though procedure is created, data is not getting inserted into the desired table.

Also i want to capture the return code after the statement executed. Please help me out.

Below is the code which i am trying.

create procedure "ABC"."EFG"

AS

BEGIN 

     declare str varchar(500);

     declare v_stmt varchar(10);

     v_matnr := '123456';

     str := 'insert into "SCHE"."ZTEST_TABLE" values (' ||V_MATNR|| ')';

     v_stmt := EXEC (:STR);

END; 

Thanks,

Ebinezar

Tags:
Not what you were looking for? View more on this topic or Ask a question