我在插入过程中遇到了问题。这是问题所在:
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','DD-MON-YY') ,
'In Process'
FROM DUAL
UNION ALL
SELECT 'O19001' ,
'C00001' ,
to_date('12-JUN-02','DD-MON-YY') ,
'Delhi' ,
'S00001' ,
'F' ,
'N' ,
to_date('20-JUN-02','DD-MON-YY') ,
'In Process'
FROM DUAL
UNION ALL
SELECT 'O19002' ,
'C00002' ,
to_date('25-JUN-02','DD-MON-YY'),
'Delhi' ,
'S00002' ,
'P' ,
'N' ,
to_date('27-JUL-02','DD-MON-YY') ,
'Cancelled'
FROM DUAL
我在短语* to_date('12 -JUN-02','DD-MON-YY')*面临例外情况*:
ORA-01843:不是有效月份
我的导师找不到问题,这里有什么问题?
答案 0 :(得分:18)
这主要是因为未正确设置NLS_DATE_LANGUAGE
。
首先通过以下方式检查值:
select * from v$nls_parameters where parameter like '%DATE%'
如果NLS_DATE_LANGUAGE
的值不是American
,请按以下方式更改:
alter session set nls_date_language='American';
再试一次。