Skip to Content
avatar image
Former Member

HANA Stored Procedures.. Insufficient Priv when Executing & How does default schema work?

Hi - I am very new to the HANA development. What i am trying to do is create a stored procedure which access data from standard SAP tables (tables from SAPDEC schema). I am stuck up with 2 issues and hence would help from the experts here.

(a) When i try to execute the stored procedure, I am getting the below error saying "SAP DBTech JDBC: [258]: insufficient privilege: Not authorized". The database user have SELECT access on the SAPDEC schema. Does the DB user need to have "EXECUTE" access on the HANA procedure created on "Object Privileges" tab?

(b) I have set the default schema for the procedure to SAPDEC schema. Now when the stored procedure is transported to the QA environment, how will this HANA procedure work as the schema in QA would be say SAPQEC (that's where the standard SAP tables are stored? Will the default schema in the procedure definition have to be changed to SAPQEC manually in the QA environment?


~Thanks... Balaji

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 19, 2015 at 05:09 AM

    Hi Balaji,

    1. You need to have an execute privilege on SAPDEC schema if you are trying to execute procedures created by others. If your trying to execute procedure created by you, you don't need one. So try giving execute privilege on SAPDEC schema to you and it should solve the issue.

    2. I believe it should not be done that way as it is not advisable to change the code in QA or PROD, instead you can create a common schema lets say SAPCEC and created synonyms in this schema to point to objects in SAPDEC schema. Use this common schema in the code and when the delivery unit is migrated to QA or PROD, you just have to change the synonyms to point to right schema and need not change the code. This is one of the approach where you can avoid the code change.

    Regards

    Anil

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2015 at 02:53 AM

    Hi Balaji,

    Can you place the screenshots here, what you are trying to do? How you are executing the procedure and the error screenshot. That will help to understand more.

    Thanks & Regards,

    Vijay

    Add comment
    10|10000 characters needed characters exceeded