Table does not exist, with Error OBE-04043 reported

2024-12-02 03:48:29  Updated

This topic describes how to handle Error OBE-04043, where a table to be queried does not exist in the Oracle mode of OceanBase Database.

Symptom

When you query the student table, this error is returned, indicating that the table does not exist.

obclient [SYS]> desc student;
OBE-04043: object SYS.STUDENT does not exist

The error codes corresponding to this error message are as follows:

  • Error code: OBE-04043

  • Error code in OceanBase Database: 5400

  • SQLSTATE: HY000

For more information about the error codes, see Overview of error codes.

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.

  1. If the table does not exist, we recommend that you check whether the table name is correct. If yes, execute the CREATE TABLE statement to create a table as needed. For 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)
    );
    
  2. After the table is created, view the schema of the 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
    

Contact Us