Inconsistent data types, with Error OBE-00932 reported

2024-12-02 03:48:29  Updated

This topic describes how to handle Error OBE-00932, where data is truncated while being inserted into the Oracle mode of OceanBase Database.

Symptom

When data is inserted into the info table, an error occurs, indicating that the data was truncated.

obclient [SYS]> INSERT INTO info VALUES(1970);
OBE-00932: inconsistent datatypes

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

  • Error code: OBE-00932

  • Error code in OceanBase Database: 5083

  • SQLSTATE: 22000

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

Possible causes

The type of the data to be inserted is inconsistent with that of the target column in the table.

Troubleshooting procedure

Perform the following steps to view the type and length of each field in the current table and insert a valid value.

  1. View the schema of the info table.

    obclient [SYS]> DESC info;
    +-------+------+------+-----+---------+-------+
    | FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA |
    +-------+------+------+-----+---------+-------+
    | C1    | DATE | YES  | NULL | NULL    | NULL  |
    +-------+------+------+-----+---------+-------+
    1 row in set
    
  2. Insert a valid value based on the field type.

    obclient [SYS]> INSERT INTO info VALUES(date'1970-01-01');
    Query OK, 1 row affected
    
  3. View the inserted data.

    obclient [SYS]> SELECT * FROM info;
    +-----------+
    | C1        |
    +-----------+
    | 01-JAN-70 |
    +-----------+
    1 row in set
    

Contact Us