Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Grant query with dynamic user subquery  RSS feed

 
Abhra Kar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi ,
         I execute the grant option on XXX type on ABC user with query-1 successfully

query-1:  GRANT EXECUTE ON XXX TO ABC WITH GRANT OPTION;

I fetched current user using query-2 successfully

query-2:  select user from dual;

Now I want to execute query-1 with the user dynamically.SO I tried to store a user in a variable Say user_name

and execute query 1 like ---

GRANT EXECUTE ON XXX TO user_name WITH GRANT OPTION;

I also tried with GRANT EXECUTE ON XXX TO (select user from dual) WITH GRANT OPTION;

But compilation fails.

Please help me to solve this.

Thanks
 
Dave Tolls
Ranch Hand
Posts: 2724
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us the relevant code, as well as the compilation error?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!