This content has been marked as final. Show 6 replies
I am able to do this command from sqlplus like this:
sql> select count(*) from dba_directories where directory_name = 'DIR0001';
I get a count of 1. But when I try this in a pl/sql procedure, I get an error:
select count(*) into ocount from dba_directories where directory_name = 'DIR0001';
error: table or view does not exist.
When you say "And you should not have it.", there is nobody else -- I work alone -- so how do I give myself this privilege?
Thank you again.
Stored objects with DEFINER rights (default) ignore role based privileges. Most likely you have select on dba_directories via DBA role. You need a directly (not via role) granted SELECT on DBA_DIRECTORIES. Login AS SYSDBA and issue:
Then login as your-id and compile stored procedure.
GRANT SELECT ON DBA_DIRECTORIES to your-id;
Are you specializing in doc questions in this forum?
You don't need access to dba_directories!
All_directories provides a list of all directories you have access to.
You should study the principles of the data dictionary in your documentation and learn to use the view DICT which has all info on the dictionary.
Oracle is not for the lazy and this forum is not to answer over and over again the redundant questions of the lazy.
Senior Oracle DBA