Adsense Ad

Friday, 19 May 2017

Oracle: ORA-01830 Error Message

ORA-01830 Error Message

Learn the cause and how to resolve the ORA-01830 error message in Oracle.

Description

When you encounter an ORA-01830 error, the following error message will appear:
  • ORA-01830: date format picture ends before converting entire input string

Cause

You tried to enter a date value, but the date entered did not match the date format.

Resolution

The option(s) to resolve this Oracle error are:

Option #1

This error can occur when you try to enter a date value without using the TO_DATE function.
In Oracle, the default date format is generally DD-MON-YYYY. If you try to enter a date value that does not comply with this format, you need to use the TO_DATE function.
For example, if you tried to execute the following SQL statement:
INSERT INTO supplier
VALUES
(1, 'IBM', '13-DEC-2004 6:56 PM');
You would receive the following error message:
Oracle PLSQL
To correct this error, you can use the TO_DATE function as follows:
INSERT INTO supplier
VALUES
(1, 'IBM', TO_DATE('13-DEC-2004 6:56 PM', 'dd-mon-yyyy hh:mi PM'));

No comments: