dba_sys_privs, object does not exist.

I want to check if I have write privileges on a table.

I check this with below sql,


select *
from dba_sys_privs sp
where exists (select 1
              from dba_users
              where username = sp.grantee)
AND privilege like 'INSERT%'

Access to dba_sys_privs ,all_sys_privs ,user_sys_privs to check this information,yields in
object does not exist.
gram77Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gram77Author Commented:
What is the alternative for checking if I can insert into a table
0
SujithData ArchitectCommented:
YOu can directly select from user_tab_privs to see whether you are granted any insert privileges on the table.
As
select * from user_tab_privs 
where table_name = '<your table name in upper case>';

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
schwertnerCommented:
To run this query you have to log as SYS user:

SQL> select *
  2  from dba_sys_privs sp
  3  where exists (select 1
  4                from dba_users
  5                where username = sp.grantee)
  6  AND privilege like 'INSERT%'
  7  ;

GRANTEE                        PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
SYS                            INSERT ANY TABLE                         NO
0
johnsoneSenior Oracle DBACommented:
As sujith80 suggested, you need to be looking at user/all/dba_tab_privs, not user/all/dba_sys_privs.

I would user user_tab_privs if you are looking for privileges granted to the user you are connected as.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.