Maya Strickland
Maya Strickland

Reputation: 21

What is this error message? ORA-00932: inconsistent datatypes: expected DATE got NUMBER

I am trying to make records in Oracle APEX. Below is what I have so far:

INSERT INTO Orders VALUES ( 2783764598765, 8931, 20220101, 20220113 ); 

The last two values are supposed to be in the date format, but I keep getting an error message.

Upvotes: 0

Views: 70

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521178

You need to use valid date literals, such as:

INSERT INTO Orders (col1, col2, date1, date2)
VALUES (2783764598765, 8931, date '2022-01-01', date '2022-01-13');

Note also that I suggest above explicitly listing out which columns you want to target with your insert. This is best practice when doing an insert.

Upvotes: 4

Related Questions