I've followed several tutorials to setup an XSJS/UI5 application on the Hana Cloud Platform (trial). The tutorial: 8 Easy Steps to Develop an XS application on the SAP HANA Cloud Platform works, but the application is not using a stored procedure.
When I try to create an application with a simple procedure, the following message appears:
InternalError: dberror(Connection.prepareCall): 258 - insufficient privilege: Not authorized at ptime/query/checker/query_check.cc:2547 (line 70 position 0 in /<username>trial/hihanaxs/hello/hihanaxs2/crawl.xsjs)
This problem is caused by the fact that I cannot grant authorizations on procedures to my user through the wrapper procedure. The wrapper procedures are described here: SAP HANA Cloud Platform
The procedure I'm trying to run is a very simple testprocedure that only changes an output variable (see attachment).
I've added the following line to my model_access role:
sql object <username>trial.hihanaxs.hello.hihanaxs2:TEST.hdbprocedure: EXECUTE;
Then I try to synchronize the roles (as it was already assigned to my user) with: CALL "HCP"."HCP_SYNCHRONIZE_ROLES". The error message:
User DEV_9BSSYUIX59J8CCYOSLLT48W6Y is not authorized for: Object: <username>trial.hihanaxs.hello.hihanaxs2::TEST Schema: DEV_9BSSYUIX59J8CCYOSLLT48W6Y Type: PROCEDURE
HCP_GRANT_ROLE_TO_USER procedure gives the same error message. When I remove the line (sql object ...) the wrapper procedures run without error messages.
I've also tried CALL "HCP"."HCP_GRANT_SELECT_ON_ACTIVATED_OBJECTS" (no error messages) and call "HCP"."HCP_GRANT_SELECT_ON_ACTIVATED_OBJECT"('<username>trial.hihanaxs.hello.hihanaxs2', 'TEST'). This last procedure execution gives the error: user-defined error exception: Object: TEST does not exist in package: <username>trial.hihanaxs.hello.hihanaxs2
The TEST procedure was present only in the DEV_9BSSYUIX59J8CCYOSLLT48W6Y schema, but putting it in the NEO..... package doesn't fix. I've also tried the proposed solution from this post (Can not assign Privileges for procedures in HANA trial).
It is impossible for me to create applications using stored procedures. Does anyone have an idea how to solve this?