This topic describes how to handle the ORA-00932 error, where data was truncated while being inserted to OceanBase Database in Oracle mode.
Symptom
When data is being inserted into the info table, an error is reported indicating that the data was truncated.
obclient [SYS]> INSERT INTO info VALUES(1970);
ORA-00932: inconsistent datatypes
The error codes corresponding to this error message are as follows:
Error code: ORA-00932
Error code in OceanBase Database: 5083
SQLSTATE: 22000
For more information about the error codes, see Error code overview.
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 an invalid value.
View the schema of the
infotable.obclient [SYS]> DESC info; +-------+------+------+-----+---------+-------+ | FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA | +-------+------+------+-----+---------+-------+ | C1 | DATE | YES | NULL | NULL | NULL | +-------+------+------+-----+---------+-------+ 1 row in setInsert a valid value based on the field type.
obclient [SYS]> INSERT INTO info VALUES(date'1970-01-01'); Query OK, 1 row affectedView the inserted data.
obclient [SYS]> SELECT * FROM info; +-----------+ | C1 | +-----------+ | 01-JAN-70 | +-----------+ 1 row in set