cancel
Showing results for 
Search instead for 
Did you mean: 

Grant privilege to Select on a view

PaulTiemann
Participant
0 Kudos

Hello,

I have created a view with the following SQL Statement:

Set Schema "TEST_SCHEMA";

Drop view AN_LAST_PRICE;

Create view AN_LAST_PRICE AS ...

I can do the following:

Select * from AN_LAST_PRICE;

Now my colleage didn't have the permissions to select on my view. But he could do the following as well:

Set Schema "TEST_SCHEMA";

Drop view AN_LAST_PRICE2;

Create view AN_LAST_PRICE2 AS ...

With the same sub query I have used.

Now I wanted to grant him the select privilege to my view:

GRANT SELECT ON "TEST_SCHEMA"."AN_LAST_PRICE" to S000XXXXXX;

This results in:

Could not execute 'GRANT SELECT ON "TEST_SCHEMA"."AN_LAST_PRICE" to S000XXXXXX' in 1.234 seconds .

SAP DBTech JDBC: [258] (at 36): insufficient privilege: Not authorized to grant the privilege on the view: line 1 col 37 (at pos 36)

Do you know which privilege I miss?

Or how I can grant the privilege to select on my view to another user?

Accepted Solutions (1)

Accepted Solutions (1)

PaulTiemann
Participant
0 Kudos

Thank you Wenjun,

I have checked your post but it did not help.

The problem is that the View I have created is based on a schema created by the SLT.

My colleage and I have the same permissions on the SLT schema. Then we both create a View based on the same tables, which we can both access via a Select Statement, we cannot make a Select on the views of each other.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Paul,

You may have a look at . I think what you are missing is the "WITH GRANT" option. For the underlying tables, you need to be granted SELECT privilege with grant option. So, you can grant the view to others further.

Best regards,

Wenjun