I have created an application in which I'm calling XSJS file from the browser and in that XSJS file I am calling a normal SQL procedure. In that procedure after some validations I'm calling R procedure. My requirement is to create that R procedure in the user schema when the user calls the XSJS file. And call statement for that R procedure should be updated in SQL procedure. So basically every time a user calls XSJS file the R procedure should be dropped and created again in the user schema. I am using SAP HANA studio latest version.
Asked
Active
Viewed 1,084 times
0
-
1Not quite sure I see a question here. What exactly do you want to know? Where is the problem for you? Creating procedures? Calling those procedures? – Lars Br. Oct 10 '16 at 01:23
-
Why do you need to recreate the procedure? Usually creating database artifacts during runtime is not the best idea. – AHaberl Oct 12 '16 at 12:03
-
Definitely not the best. – Suncatcher Oct 17 '16 at 17:29
1 Answers
0
If you want to execute dynamic SQL in SAP HANA, you can use EXECUTE IMMEDIATE SQL command that will work in read and write procedures. You can build SQL query to create a new procedure in xsjs, send this query to a read and write procedure in which you have to use EXECUTE IMMEDIATE QUERY to get your procedure created and same can be done for deletion as well.

Nikhitha Reddy
- 285
- 7
- 19