Oracle errors

ORA-00942: table or view does not exist

ORA-00942: table or view does not exist

Oracle cannot find the table or view — or it exists but you have no privilege on it. Check the name and the schema prefix, then the privileges. Oracle deliberately shows the same error in both cases.

What it means

To avoid revealing which objects exist, Oracle returns ORA-00942 both when an object is missing and when you are not allowed to see it. So the error does not prove the table is gone. Since Oracle 23ai the message also names the object.

Common causes

How to fix it

  1. Check that the object exists and who owns it: SELECT owner, object_type FROM all_objects WHERE object_name = 'EMPLOYEES' (it only shows objects you can see; a DBA can check DBA_OBJECTS).
  2. Prefix the owner, or create a synonym.
  3. Ask the owner or a DBA for the privilege: GRANT SELECT ON hr.employees TO app_user.
  4. For PL/SQL, grant the privilege directly to the procedure owner instead of through a role.
  5. Confirm where you are connected: SELECT sys_context('USERENV','CON_NAME'), user FROM dual.

Example

Where does the object live and can I see it?

SELECT owner, object_name, object_type
  FROM all_objects
 WHERE object_name = 'EMPLOYEES';

Grant directly (needed for definer’s-rights PL/SQL):

GRANT SELECT ON hr.employees TO app_owner;

In SQLlightspeed

When a statement fails, SQLlightspeed’s error panel shows the error code with a plain-language explanation and a suggestion for what to do next, together with Oracle’s own message and a link to Oracle’s documentation — for this error and dozens of other common ones.

Related errors

ORA-01031ORA-00904ORA-01017 All Oracle errors →

Oracle documentation for ORA-00942. Oracle is a registered trademark of Oracle Corporation. SQLlightspeed is not affiliated with Oracle.