cancel
Showing results for 
Search instead for 
Did you mean: 

How To Create SAP Hana Database User Though Procedures

0 Kudos

I want to create SAP HANA Database User using Procedures in SAP Web IDE.

When I am trying to run the procedure in sql console of SAP Web IDE, I get the following error :

Please suugest on how to create SAP HANA Database User using Procedures.

My Procedure has following code :

PROCEDURE "create_user"( )
   LANGUAGE SQLSCRIPT
   SQL SECURITY INVOKER
   --DEFAULT SCHEMA <default_schema_name>
   READS SQL DATA AS
BEGIN
   /*************************************
       Write your procedure logic 
   *************************************/
   EXEC 'CREATE USER ABC PASSWORD Welcome123';
   
END

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

First you should get the additional details for the error message using procedure SYS.GET_INSUFFICIENT_PRIVILEGE_ERROR_DETAILS like described here.

There are two possible results:

- The user trying to execute the procedure has no execution privileges for the procedure -> in that case you have to add the execution privilges to the user.

- The user trying to execute the procedure has no privileges to create a user. System privilege USER ADMIN is necessary for that.

Answers (0)