Skip to Content

Access Control Statements in Stored Procedures

Hi,

I have created a Odata service on Sys.Users view to expose the User details as a Service. I need to enhance the service to perform CUD (Create, Update and Delete) operations. For this, I'm using the Odata Exit features where I call different stored procedures for respective operations.

In the procedure, I would like to use Access Control Statements - Create User, ALTER User and DROP User. But the system doesn't suggest these keywords inside the Procedure.

Could you please suggest if my approach is correct ? If so, why is it the system not allowing to use these keywords. I tried using ALTER User and the error says - 'Alter is incorrect or misplaced'.

Any suggestions ?

Regards,

Naresh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Aug 08, 2016 at 10:42 PM

    Show your code. We cannot guess what is wrong with it...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 09, 2016 at 03:38 AM

    Hi Naresh ,

    I think it is related to dynamic sql.

    You cannot write plain vanilla create,alter or other DDL statements in sql script.


    Please search for dynamic sql in hana you will have n number of threads for these.

    have a look at these thread, it might help you.


    http://www.hdespot.com/2015/05/01/how-to-perform-mass-user-creation-role-assignment/


    -

    Pratik

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.