I got ” ORA-04043: object does not exist ” error in Oracle database.
ORA-04043: object does not exist
Details of error are as follows.
ORA-04043: object does not exist Cause: An object name was specified that was not recognized by the system. There are several possible causes: - An invalid name for a table, view, sequence, procedure, function, package, or package body was entered. Since the system could not recognize the invalid name, it responded with the message that the named object does not exist. - An attempt was made to rename an index or a cluster, or some other object that cannot be renamed. Action: Check the spelling of the named object and rerun the code. (Valid names of tables, views, functions, etc. can be listed by querying the data dictionary.)
object does not exist
This ORA-04043 error is related with the object name was specified that was not recognized by the system. There are several possible causes:
– An invalid name for a table, view, sequence, procedure, function, package, or package body was entered. Since the system could not recognize the invalid name, it responded with the message that the named object does not exist.
Check the spelling of the named object and rerun the code. (Valid names of tables, views, functions, etc. can be listed by querying the data dictionary.)
If you choose the table name double quotes, you need to call it with double quotes
So If you created the table name as “Mehmet”, you need call it with Desc “Mehmet“, not desc Mehmet
You can check the object in dba_object table as follows.
SElect object_name,object_type from dba_objects where object_name like '%OBJECT_NAME%';
Sometimes, this error is get because of missing schema owner of table. So You should use the table name with Schema owner as follows.
select * from SCHEMA_OWNER.TABLE_NAME;
Normally, there is no MEHMET table as follows and I will create and check it.
SQL> desc MEHMET ERROR: ORA-04043: object mehmet does not exist SQL> CREATE TABLE MEHMET 2 ( 3 UserID int, 4 FirstName varchar(100), 5 LastName varchar(100), 6 City varchar(100) 7 ); Table created. SQL> SQL> desc MEHMET Name Null? Type ----------------------------------------- -------- ---------------------------- USERID NUMBER(38) FIRSTNAME VARCHAR2(100) LASTNAME VARCHAR2(100) CITY VARCHAR2(100) SQL>
If you don’t specify the Schema before table name, then this table is created under SYSTEM Schema automatically.
If you want to create the table under the specific Schema, then create it as follows.
SQL> CREATE TABLE MSDEVECI.MYEMPLOYEE ( EMPLOYEE_ID NUMBER(6), FIRST_NAME VARCHAR2(20 BYTE), LAST_NAME VARCHAR2(25 BYTE), HIRE_DATE DATE, JOB_ID VARCHAR2(10 BYTE), SALARY NUMBER(8,2) ); Table created. SQL> DESC MSDEVECI.MYEMPLOYEE Name Null? Type ----------------------------------------- -------- ---------------------------- EMPLOYEE_ID NUMBER(6) FIRST_NAME VARCHAR2(20) LAST_NAME VARCHAR2(25) HIRE_DATE DATE JOB_ID VARCHAR2(10) SALARY NUMBER(8,2) SQL> desc MYEMPLOYEE ERROR: ORA-04043: object MYEMPLOYEE does not exist SQL>
Do you want to learn Oracle Database for Beginners, then read the following articles.
Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )