Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Grant query with dynamic user subquery

 
Abhra Kar
Ranch Hand
Posts: 154
  • 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: 2361
25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us the relevant code, as well as the compilation error?
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!