I have a cursor in PLSQL procedure to select from DBA_TABLES and USER_TABLES.
CURSOR c1 IS
SELECT DISTINCT(DB.TABLE_NAME) FROM DBA_TABLES DB, USER_TABLES UT WHERE DB.TABLE_NAME = UT.TABLE_NAME AND DB.IOT_TYPE IS NOT NULL;
BEGIN
OPEN c1;
FETCH c1 INTO IOT_TABLE;
CLOSE c1;
However the procedure complain
"ORA-00942 Table or View does not exist"
during execute.
The user has to have SELECT privilege on that view.
To check whether the user has the SELECT permission against this view, login as this user and run the below query:
If this query returns none, then the user has no rights to that view and cannot see it.
In order to grant this privilege to that user, login as SYS or SYSTEM, and issue:
After this the user should see a result like below, and will have access to that view: