我在插入过程中遇到了问题.这是问题所在:
INSERT INTO SALES_ORDER_A4 (ORDERNO,CLIENTNO,ORDERDATE,DELYADDR,SALESMANNO,DELYTYPE,BILLYN,DELYDATE,ORDERSTATUS) SELECT 'O19008','C00005',to_date('24-MAY-02','DD-MON-YY'),'Delhi','S00004','F','N',to_date('26-MAY-02','In Process' FROM DUAL UNION ALL SELECT 'O19001','C00001',to_date('12-JUN-02','S00001',to_date('20-JUN-02','In Process' FROM DUAL UNION ALL SELECT 'O19002','C00002',to_date('25-JUN-02','S00002','P',to_date('27-JUL-02','Cancelled' FROM DUAL
我在短语* to_date(’12 -JUN-02′,’DD-MON-YY’)*面临一个例外:
ORA-01843: not a valid month
我的导师找不到问题,这里有什么问题?
解决方法
这主要是因为未正确设置NLS_DATE_LANGUAGE.
首先检查以下值:
select * from v$nls_parameters where parameter like '%DATE%'
如果NLS_DATE_LANGUAGE的值不是美国人,则将其更改为:
alter session set nls_date_language='American';
然后再试一次.