ORA-00932: inconsistent datatypes: expected NUMBER got DATE

kIsH@STAX<>CREATE INDEX rp_gbl_ind ON kish.rp(R_ID)
GLOBAL PARTITION BY RANGE(R_ID)
(PARTITION ind_date_p1 VALUES LESS THAN (TO_DATE(' 2022-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')),
 PARTITION ind_date_p2 VALUES LESS THAN (TO_DATE(' 2022-02-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS' )),
 PARTITION ind_date_p3 VALUES LESS THAN (TO_DATE(' 2022-03-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')),
 PARTITION ind_date_p4 VALUES LESS THAN (MAXVALUE));
  2    3    4    5    6  (PARTITION ind_date_p1 VALUES LESS THAN (TO_DATE(' 2022-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')),
                                         *
ERROR at line 3:
ORA-00932: inconsistent datatypes: expected NUMBER got DATE

kIsH@STAX<>oerr ora 00932
SP2-0734: unknown command beginning “oerr ora 0…” – rest of line ignored.
kIsH@STAX<>!oerr ora 00932
00932, 00000, “inconsistent datatypes: expected %s got %s”
// *Cause: One of the following:
// – An attempt was made to perform an operation on incompatible
// datatypes. For example, adding a character field to a date
// field (dates may only be added to numeric fields) or
// concatenating a character field with a long field.
// – An attempt was made to perform an operation on a database
// object (such as a table or view) that was not intended for
// normal use. For example, system tables cannot be modified by
// a user. Note that on rare occasions this error occurs
// because a misspelled object name matched a restricted
// object’s name.
// – An attempt was made to use an undocumented view.
// *Action: If the cause is
// – different datatypes, then use consistent datatypes. For
// example, convert the character field to a numeric field with
// the TO_NUMBER function before adding it to the date field.
// Functions may not be used with long fields.
// – an object not intended for normal use, then do not access
// the restricted object.

Leave a Reply