1. Invalid month problem
When you recently inserted a time into the database, Oracle reported an "invalid month issue" with the following SQL:
Copy Code code as follows:
INSERT into Ts_count (
Id,cname, StartTime, Endtime,value
) VALUES (
1, ' John ', ' 01/06/2013 ', ' 02/06/2013 ', 800
);
Error: ORA-01843: Invalid month. This is due to incorrect date format.
Solution:
With select Sysdate from dual; To see the default date format, and then press the date format in the system, the input will solve the problem.
2, Date insertion format problem
When inserting date format data, report ORA-01861: text does not match the format string.
If you directly use the To_date (' 2007-12-28 10:07:24 ') without specifying a date format, you will get an error: ORA-01861: Text does not match the format string, you must specify a date format.
As follows:
Copy Code code as follows:
To_date (' 2007-12-28 10:07:24 ', ' yyyy-mm-dd hh24:mi:ss ')