This topic describes how to handle the ORA-04043 error, where a queried table does not exist in OceanBase Database in Oracle mode.
Symptom
When you query the student table, this error is returned, indicating that the table does not exist.
obclient [SYS]> desc student;
ORA-04043: object SYS.STUDENT does not exist
The error codes corresponding to this error message are as follows:
ORA-04043
Error code in OceanBase Database: 5400
SQLSTATE: HY000
For more information about the error codes, see Error code overview.
Possible causes
If the target table does not exist, the system returns an error.
Troubleshooting procedure
Take the following steps to check whether a table exists and create the table if it does not exist.
If the table does not exist, we recommend that you check whether the table name is correct. If yes, execute the
CREATE TABLEstatement to create a table as needed. Example:obclient [SYS]> CREATE TABLE student( id NUMBER, name varchar2(18), sex char(1), age NUMBER, address varchar2(200), email varchar2(100), c_date date, PRIMARY KEY (id) );After the table is created, check the schema of the created table.
obclient [SYS]> desc student; +---------+---------------+------+-----+----------+-------+ | FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA | +---------+---------------+------+-----+----------+-------+ | ID | NUMBER(38) | NO | PRI | NULL | NULL | | NAME | VARCHAR2(18) | YES | NULL | NULL | NULL | | SEX | CHAR(1) | YES | NULL | NULL | NULL | | AGE | NUMBER(38) | YES | NULL | NULL | NULL | | ADDRESS | VARCHAR2(200) | YES | NULL | NULL | NULL | | EMAIL | VARCHAR2(100) | YES | NULL | NULL | NULL | | C_DATE | DATE | YES | NULL | NULL | NULL | +---------+---------------+------+-----+---------+-------+ 7 rows in set