cancel
Showing results for 
Search instead for 
Did you mean: 

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

balajigramancg1
Explorer
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

former_member185165
Active Participant
0 Kudos

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