简体   繁体   English

应用程序错误:ORA-19202:XML 处理出错 ORA-01843:无效月份 - Oracle Apex

[英]Error in application: ORA-19202: Error occurred in XML processing ORA-01843: not a valid month - Oracle Apex

I have a problem in Oracle Apex tool.我在 Oracle Apex 工具中遇到问题。 Namely, I was making a table reservation application and I wanted to print all reservations under a specific date.也就是说,我正在申请餐桌预订,我想打印特定日期下的所有预订。 So I choose the date under which I want to print all bookings, press the print button, and Apex throws me the following error:所以我选择了我想要打印所有预订的日期,按下打印按钮,Apex 向我抛出以下错误:

ORA-19202: Error occurred in XML processing ORA-01843: not a valid month. ORA-19202:处理 XML 时出错 ORA-01843:无效月份。

Previously, I had neatly added AOP and a word document.以前,我已经巧妙地添加了 AOP 和一个 word 文档。

In the right window, I selected in SQL data type: SQL, and in code data I put the code.在右侧窗口中,我选择了 SQL 数据类型:SQL,在代码数据中我放置了代码。 Later I added "TO DATE in code", but that doesn't fix my problem.后来我添加了“TO DATE in code”,但这并不能解决我的问题。

Here is the code:这是代码:

select 
    'file1' as "filename",
    cursor(select
        TO_DATE(D.SIFRA_DATUMA_REZERVACIJE, 'MM/DD/YYYY') as "datum_rezervacije",
        cursor(select
            R.SIFRA_REZERVACIJE as "sifra_rezervacije", 
            G.IME_PREZIME as "ime_prezime", 
            R.BROJ_OSOBA as "broj_osoba",
            S.SIFRA_STOLA as "broj_stola",
            R.NAPOMENA_REZERVACIJE as "napomena",
            P.NAZIV_PRIGODE as "prigoda"
            from 
        GOST G, PRIGODA P, STOL S, REZERVACIJA R   where 
            R.SIFRA_GOST_REZERVACIJA = G.SIFRA_GOSTA
            and R.SIFRA_STOL_REZERVACIJA = S.SIFRA_STOLA
            and R.SIFRA_PRIGODE_REZERVACIJA = P.SIFRA_PRIGODE 
            and TO_DATE(R.SIFRA_DATUM_REZERVACIJE_REZERVACIJA, 'MM/DD/YYYY' ) = TO_DATE(:P6_NEW, 'MM/DD/YYYY') order by TO_DATE(R.SIFRA_DATUM_REZERVACIJE_REZERVACIJA, 'MM/DD/YYYY')) as "rezervacija"
        from
        DATUM_REZERVACIJE D  
        where 
        TO_DATE(D.SIFRA_DATUMA_REZERVACIJE, 'MM/DD/YYYY')= TO_DATE(:P6_NEW, 'MM/DD/YYYY')) as "data" 
from dual;

在此处输入图片说明

在此处输入图片说明

Your date format is in "american style" but the language the column name specified on is obviously not english.您的日期格式是“美国风格”,但列名指定的语言显然不是英语。 Could it be that you're converting date into wrong format and the 'dd/mm/yyyy' is the right format to be used here?可能是您将日期转换为错误的格式,而“dd/mm/yyyy”是此处使用的正确格式?

For example, insert 30 of December in the table first例如,首先在表中插入 12 月 30 日

insert into some_table(date_col) values(to_date('30/12/2019', 'dd/mm/yyyy'));

then this (see the date format) will cause the same you are experiencing - not a valid month那么这(请参阅日期格式)将导致您遇到相同的情况 - 不是有效月份

select to_date(date_col, 'mm/dd/yyyy') from some_table;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM