Database Administration (MOSC)

MOSC Banner

SQL query syntax

edited Oct 6, 2010 4:08AM in Database Administration (MOSC) 4 commentsAnswered ✓
 I want to check a user's system and object privilege. I issued the following query:

select grantee, null table_name, privilege from dba_sys_privs where grantee='SCOTT'
union all
select grantee, table_name, privilege from dba_tab_privs where grantee='SCOTT';

This query worked fine. No problem there.

However, I want to be able to input the grantee name every time I run the query. So I modified the query a little bit.

select grantee, null table_name, privilege from dba_sys_privs where grantee=&grantee
union all
select grantee, table_name, privilege from dba_tab_privs where grantee=&grantee;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center