gpt4 book ai didi

sql - ORA-01843 : not a valid month : TO_DATE ('12-JUN-02' ,'DD-MON-YY' )

转载 作者:行者123 更新时间:2023-12-03 15:57:51 25 4
gpt4 key购买 nike

我在插入过程中遇到了问题。这是问题所在:

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')*上遇到了一个异常(exception):

ORA-01843: not a valid month



我的教练找不到问题,这是什么问题?

最佳答案

这主要是因为NLS_DATE_LANGUAGE设置不正确。

首先通过以下方式检查该值:

select * from v$nls_parameters where parameter like '%DATE%'

如果 NLS_DATE_LANGUAGE的值不是 American,则通过以下方法进行更改:
alter session set nls_date_language='American';

然后再试一次。

关于sql - ORA-01843 : not a valid month : TO_DATE ('12-JUN-02' ,'DD-MON-YY' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22009554/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com