Tuesday, January 22, 2013

"Not a Valid Month" Error

Error received when trying to insert a date into a date field:
INSERT INTO TableName(Field1)VALUES('01/22/2013');
Cause: The date format specified in an INSERT statement dow not match NLS_DATE_FORMAT parameter.
To check NLS_DATE_FORMAT parameter, run:
SELECT sysdate FROM dual;
The output should be something like this: 22-JAN-13
Solution: Modify SQL statement to read:
INSERT INTO TableName(Field1)VALUES(to_date('22-JAN-2013'));

No comments:

Post a Comment