首页 文章

01847. 00000 - “每月的日期必须介于1月的最后一天”

提问于
浏览
0
create or replace procedure new_user as
begin
fnd_user_pkg.createuser('BOBBY','oracle123',TO_DATE('7-FEB-2017'),NULL,TO_DATE('20-02-17'),'80','78960','bobby@gmail.com');
end;

我使用如下命令调用上述过程:

exec new_user();

过程符合成功,但遇到执行错误时:

从命令行7开始出错 - BEGIN new_user();结束;错误报告 - ORA-01847:月中的日期必须介于1月和最后一天之间ORA-06512:位于“APPS.NEW_USER”,第3行ORA-06512:第1行01847. 00000 - “日期必须介于两者之间1和月的最后一天“*原因:*行动:

有人能帮我吗?

2 回答

  • 1

    这个错误可能是因为 formatting of the to_date() function

    以下是一些参考示例:

    to_date('29-Oct-09', 'DD-Mon-YY')
     to_date('10/29/09', 'MM/DD/YY')
     to_date('120109', 'MMDDYY')
     to_date('29-Oct-09', 'DD-Mon-YY HH:MI:SS') 
     to_date('Oct/29/09', 'Mon/DD/YY HH:MI:SS')
     to_date('October.29.2009', 'Month.DD.YYYY HH:MI:SS')
    

    您也可以参考this link以获得进一步的参考 .

    希望这可以帮助!

  • 0

    您的 to_date 中有多种格式,但未定义它们 .

    create or replace procedure new_user as
    begin
    fnd_user_pkg.createuser('BOBBY',
                            'oracle123',
                            TO_DATE('7-FEB-2017', 'D-MON-YYYY', 'NLS_DATE_LANGUAGE=AMERICAN'), -- definition here, 'NLS_DATE_LANGUAGE=AMERICAN' can be omitted if your language is set to English
                            NULL,
                            TO_DATE('20-02-17','DD-MM-YY'), -- definition here
                            '80',
                            '78960',
                            'bobby@gmail.com');
    end;
    

相关问题