Oracle的Insert语句报错:无效的月份

以下几种格式均报:无效的月份
INSERT INTO Livell.Product (ProductID,ProductName,AddTime) VALUES(1,'123123',TO_DATE('05-MAY-2012','DD-MON-YYYY'))
INSERT INTO Livell.Product (ProductID,ProductName,AddTime) VALUES(1,'123123',TO_DATE('05-05-2012','DD-MON-YYYY'))
INSERT INTO Livell.Product (ProductID,ProductName,AddTime) VALUES(1,'123123',TO_DATE('2012-05-05','YYYY-MON-DD'))
最新回答
你与北诗

2024-11-27 08:04:00

可以使用 update props$ set value = 'YYYY-MM-DD' where parameter = 'NLS_DATE_FORMAT';先处理一下
重启数据库 然后插入
悦心自足

2024-11-27 08:16:41

INSERT INTO Livell.Product (ProductID,ProductName,AddTime) VALUES(1,'123123',TO_DATE('05-MAY-2012','dd-mon-yyyy','nls_date_language=American'))
INSERT INTO Livell.Product (ProductID,ProductName,AddTime) VAL‘ES(1,'123123',TO_DATE('05-05-2012','DD-MM-YYYY'))
INSERT INTO Livell.Product (ProductID,ProductName,AddTime) VALUES(1,'123123',TO_DATE('2012-05-05','YYYY-MM-DD'))