Skip to content
Advertisement

SQL Error: ORA-00932: inconsistent datatypes: expected DATE got NUMBER 00932. 00000 – “inconsistent datatypes: expected %s got %s”

create table hdate
(
hidate Date
);

insert into hdate values(2019-04-23);

how shall I solve this problem?

Advertisement

Answer

insert into hdate values(2019-04-23);

You must pass the value using single quotes along with proper format mask and convert it into date using TO_DATE:

insert into hdate values( TO_DATE('2019-04-23', 'YYYY-MM-DD') );

Or, better use ANSI Date literal which uses a fixed format 'YYYY-MM-DD':

insert into hdate values(DATE '2019-04-23');
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement