create procedure dynamic in HANA XS

161 views Asked by At

I am trying to "translate" the following command into dynamic SQL to be used in a procedure:

SELECT *, 'IDS' AS SYSID FROM MODE_TEST.USR02

Can someone help with this question? I am facing problems with the 'IDS'.

thanks,

regards,

1

There are 1 answers

4
Suchitra On

You can use like below:

do begin
declare str nvarchar(1000);
str='SELECT *,''IDS'' AS "SIYSID" FROM MODE_TEST.USR02';
execute immediate :str;
end;