Need help in understanding the error ORA-01843: not a valid month - ECX_ACT

Hello All,
We need help in understanding the Transaction Monitor -> Processing Message (error "ORA-01843: not a valid month - ECX_ACTIONS.GET_CONVERTED_DATE").
And how to enable the log for Transaction Monitor -> Processing Logfile.
Actually we are trying to import the Purchase Order XML (OAG) into eBusiness Suite via BPEL Process Manager using the Oracle Applications Adapter. The process is working fine with expected payload until it reaches the XML Gateway Transaction Monitor, where we are getting this error.
thanks
muthu.

Hello All,
We need help in understanding the Transaction Monitor -> Processing Message (error "ORA-01843: not a valid month - ECX_ACTIONS.GET_CONVERTED_DATE").
And how to enable the log for Transaction Monitor -> Processing Logfile.
Actually we are trying to import the Purchase Order XML (OAG) into eBusiness Suite via BPEL Process Manager using the Oracle Applications Adapter. The process is working fine with expected payload until it reaches the XML Gateway Transaction Monitor, where we are getting this error.
thanks
muthu.

Similar Messages

  • [PL/SQL Error] ORA-01843: not a valid month, not sure how to troubleshoot

    Trying to use PL/SQL to automatically create a report that show the following:
    Daily:      
    # of Registered Users      
    # of Completes (assessment)      Average per User
    # of Starts (assessment)      Average per User
    Weekly:      
    # of Registered Users      
    # of Completes (assessment)      Average per User
    # of Starts (assessment)      Average per User
    Yearly:      
    # of Registered Users      
    # of Completes (assessment)      Average per User
    # of Starts (assessment)      Average per User
    When I run the PL/SQL I get the following
    [error]
    ORA-01843: not a valid month
    [error]
    The error occurs on this part of the PL/SQL
    --registered users weekly starts
    select count(*), trunc(next_day(sysdate-29, 'SUNDAY')-7), trunc(sysdate-29)
         into v_weekly_count_total_ru, v_weekly_start_date, v_weekly_end_date
              from entities
                   where list_id = 3290
                   and participation_code_id = 10
                   and trunc(participation_date)
                   between trunc(next_day(sysdate-29, 'SUNDAY')-7) and                         
                            trunc(sysdate-29);I'm using the number 29 because I'm using a test database to test this first before moving it into production. And my test data only goes back to early August 2006.
    Also, I'm not doing anything with months, so I am suprised that it is throwing this type of error.
    thanks

    I tested a snippet of code in my production environment, just to see if I would get any results:
    --registered users weekly starts
    select count(*), trunc(next_day(sysdate-1, 'SUNDAY')-7), trunc(sysdate-1)
         --into v_weekly_count_total_ru, v_weekly_start_date, v_weekly_end_date
              from entities
                   where list_id = 3290
                   and participation_code_id = 10
                   and trunc(participation_date)
                   between trunc(next_day(sysdate-1, 'SUNDAY')-7) and trunc(sysdate-1);
    COUNT(*)     TRUNC(NEXT_DAY(SYSDATE-1,'SUND     TRUNC(SYSDATE-1)--INTOV_WEEKLY
    1     09/10/2006 00:00:00     09/11/2006 00:00:00I did a double check in my test DB to make sure there is data there:
    select count(*)
         from entities
              where trunc(participation_date)
              between to_date('01-08-2006','DD-MM-YYYY')
              and to_date('14-08-2006','DD-MM-YYYY')
              and list_id = 3290;
    COUNT(*)
    11So I'm pretty sure that I'm not pulling anything null.
    thanks

  • SQL execution error, ORA-01843: not a valid month

    Im using ASP/VBScript and its my first time starting to use Oracle as a DB provider.
    Just having an issue with a statement that I have.
    Heres my statement:
    SELECT T592_NOON.SHIP_CODE, T592_NOON.REPORT_DATE, T592_NOON.L_B, T592_NOON.AVERAGE_SPEED, T592_NOON.SEASTATE, T592_NOON.DISTANCE, T592_NOON.WIND_DIRECTION, T592_NOON.IFO_MAIN, T592_NOON.IFO_BOILER, T592_NOON.IFO_AUXENGINE FROM T592_NOON WHERE (((SHIP_CODE)='S271') AND (REPORT_DATE BETWEEN to_date('08/02/2004 13:00:00', 'DD-MON-YYYY HH24:MI') and to_date('28/02/2004 18:15:00', 'DD-MON-YYYY HH24:MI')))
    Whenever I run it it errors and returns:
    SQL execution error, ORA-01843: not a valid month
    Can anyone tell why this wouldnt work?
    REPORT_DATE type is DATE
    REPORT_DATE Sample data: 2003-04-28-12.00.00.000000

    Changing the format of the date seemed to fix it.
    Incorrect: '08/02/2004 13:00:00'
    Correct: '08-FEB-2004 13:00'

  • Date error ORA-01843: not a valid month

    Hi,
    I am in a 4.01 Apex environment with NLS_DATE_FORMAT     mm/dd/yyyy. I created a view with a CASE statements using 'when eventstartdate between '08/15/2010' and '06/1/2011' then...' clauses and the view is created fine. I also can query the view with no problem with SQL workshop and the CASE statements work as expected. When I create an interactive report on that view I keep getting ORA-01843: not a valid month. I even tried matching the format in the Interactive Report column format mask to the NLS format for the date and still get error.
    What seems especially strange to me is that even if I have the view column defined with a 'to_char' I still get the same error when I use the CASE statement to build the view. Doesn't the Interactive Report just 'see' the View column definitions-- why should it 'care' how the view was built?
    The only way I can get the View to work with an Interactive report in any manner is to remove all the CASE statements and define the 'eventstartdate' as text using to_char but that then eliminates my ability to do any filters that require date comparisons with between or '>', '<'.
    Help would be appreciated!
    Thanks,
    Pat

    Quick late night response - always convert your dates for comparison. Apples to apples
    Instead of between '01/31/2012', use either
    TO_DATE('01/31/2012', 'MM/DD/YYYY')or
    DATE '2012-01-31'More related info
    http://www.grassroots-oracle.com/2011/03/date-format-tolerance.html
    Sorry if I'm off target, thought it may help

  • Oracle error "ORA-01843: not a valid month" when trying to run sqlldr

    Hi all,
    I'm trying to load some data into a staging database via a CSV file using sqlldr, and am running into an issue where it doesn't like the date format I'm using.
    Here is my input data:
    2012-01-09 16:28:12 -05:00Here is the entry in the .ctl file:
    created TIMESTAMP WITH TIME ZONE 'yyyy-mm-dd HH24:MI:SS TZR'And finally, here is the entry in the .sql file:
    created TIMESTAMP WITH TIME ZONEAfter I try to load, I get greeted with the dreaded error message: Record 1: Rejected - Error on table WTPART, column CREATED. ORA-01843: not a valid month
    I'm really confused as to why it's blowing up on the date, because it seems to me that "01" is indeed a valid date in terms of the date format I'm using. Any ideas? Thanks!
    Edited by: Nick Tiberi on Jan 10, 2012 8:06 AM

    Hmmm, not sure exactly what the problem is. It works fine for me on my XE instance.
    Set up the control and data files....
    tubby@Tubbz:~/test$ cat >> WTPart.csv <<EOF
    2012-01-09 16:28:12 -05:00
    EOF
    tubby@Tubbz:~/test$
    tubby@Tubbz:~/test$ cat >> load.ctl <<EOF
    LOAD DATA
    INFILE WTPart.csv
    APPEND INTO TABLE WTPart
    FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    created TIMESTAMP WITH TIME ZONE 'yyyy-mm-dd HH24:MI:SS TZR'
    EOF
    tubby@Tubbz:~/test$
    tubby@Tubbz:~/test$ /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/sqlldr tubby/pswd@xe control=load.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Tue Jan 10 10:21:28 2012
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 1
    tubby@Tubbz:~/test$
    {code}
    Query the result from the database
    {code}
    ME_XE?select * from wtpart;
    CREATED
    09-JAN-12 04.28.12.000000 PM -05:00
    1 row selected.
    Elapsed: 00:00:00.01
    ME_XE?
    ME_XE?select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    5 rows selected.
    Elapsed: 00:00:00.01
    ME_XE?
    {code}
    Are you sure your CSV file doesn't have some "funky" data in it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Query with error: ORA-01843: not a valid month

    Hi,
    I have a problem with a query. I have modified a query that before worked but not now!
    The correct original query was:
    SELECT  rtrim('Cambio di: '
            || (CASE WHEN nvl(A.CODICE_EMITTENTE ,' ') <> nvl(B.CODICE_EMITTENTE ,' ') THEN 'Codice emittente, ' ELSE '' END)
            || (CASE WHEN nvl(A.DESCRIZIONE_TITOLO,' ') <> nvl(B.DESCRIZIONE_TITOLO,' ') THEN 'Descrizione titolo, ' ELSE '' END)
            || (CASE WHEN nvl(A.SOTTOSTANTE,' ') <> nvl(B.SOTTOSTANTE,' ') THEN 'Sottostante, ' ELSE '' END)
            || (CASE WHEN nvl(A.TIPO_SOTTOSTANTE, ' ') <> nvl(B.TIPO_SOTTOSTANTE,' ') THEN 'Tipo sottostante, ' ELSE '' END)
            || (CASE WHEN nvl(A.CEDOLA_LORDA_CORRENTE, 0) <> nvl(B.CEDOLA_LORDA_CORRENTE, 0) THEN 'Cedola lorda corrente, ' ELSE '' END)
            || (CASE WHEN nvl(A.FREQUENZA_CEDOLA, ' ') <> nvl(B.FREQUENZA_CEDOLA, ' ') THEN 'Frequenza cedola, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') THEN 'Data inizio facoltà call, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') THEN 'Data fine facoltà call, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') THEN 'Data inizio facoltà put, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') THEN 'Data fine facoltà put, ' ELSE '' END)
            || (CASE WHEN nvl(A.AMMONTARE_EMESSO, 0) <> nvl(B.AMMONTARE_EMESSO, 0) THEN 'Ammontare emesso, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') <> nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999') THEN 'Data primo godimento, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_SCADENZA, '31-Dec-2999') <> nvl(B.DATA_SCADENZA, '31-Dec-2999') THEN 'Data scadenza, ' ELSE '' END)
            || (CASE WHEN nvl(A.PRIMO_PREZZO_EMISSIONE, 0) <> nvl(B.PRIMO_PREZZO_EMISSIONE, 0) THEN 'Primo prezzo di emissione, ' ELSE '' END)
            || (CASE WHEN nvl(A.MODALITA_RIMBORSO, 0) <> nvl(B.MODALITA_RIMBORSO, 0) THEN 'Modalità rimborso, ' ELSE '' END)
            || (CASE WHEN nvl(A.SUBORDINAZIONE, ' ') <> nvl(B.SUBORDINAZIONE, ' ') THEN 'Subordinazione, ' ELSE '' END)
            || (CASE WHEN nvl(A.DIV_EMIS_CODE, 0) <> nvl(B.DIV_EMIS_CODE, 0) THEN 'Codice divisa di emissione, ' ELSE '' END)
            || (CASE WHEN nvl(A.DIV_EMIS, ' ') <> nvl(B.DIV_EMIS, ' ') THEN 'Divisa di emissione, ' ELSE '' END)
            ,', ') TIPO_VARIAZIONE,
           A.ISICOD ,
           A.CODICE_EMITTENTE AS EMIT_COD_T, B.CODICE_EMITTENTE AS EMIT_COD_T1, 
           A.DESCRIZIONE_TITOLO AS DESC_TITOLO_T, B.DESCRIZIONE_TITOLO AS DESC_TITOLO_T1,
           A.SOTTOSTANTE AS SOTTOSTANTE_T, B.SOTTOSTANTE AS SOTTOSTANTE_T1,
           A.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T, B.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T1,
           A.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T, B.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T1,
           A.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T, B.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T1,
           A.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T, B.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T1,
           A.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T, B.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T1,
           A.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T, B.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T1,
           A.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T, B.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T1,
           A.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T, B.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T1,
           A.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T,  B.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T1,
           A.DATA_SCADENZA AS DATA_SCADENZA_T, B.DATA_SCADENZA AS DATA_SCADENZA_T1,
           A.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T, B.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T1,
           A.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T, B.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T1,
           A.SUBORDINAZIONE AS SUBORDINAZIONE_T, B.SUBORDINAZIONE AS SUBORDINAZIONE_T1,
           A.DIV_EMIS_CODE AS DIV_EMIS_CODE_T, B.DIV_EMIS_CODE AS DIV_EMIS_CODE_T1,
           A.DIV_EMIS AS DIV_EMIS_T, B.DIV_EMIS AS DIV_EMIS_T1,
           A.START_DATE AS DATA_AGG_T, B.START_DATE AS DATA_AGG_T1
    FROM SPR_KLERS_ISD A, SPR_KLERS_ISD B
    WHERE A.START_DATE=TRUNC(SYSDATE)
          AND A.ISICOD=B.ISICOD
          AND B.START_DATE = decode(trim(to_char(sysdate, 'Day')), 'Monday',trunc(sysdate-3), trunc(sysdate-1))
          AND (nvl(A.CODICE_EMITTENTE,' ') != nvl(B.CODICE_EMITTENTE,' ')
            OR
            nvl(A.DESCRIZIONE_TITOLO,' ') != nvl(B.DESCRIZIONE_TITOLO,' ')
            OR
            nvl(A.SOTTOSTANTE,' ') != nvl(B.SOTTOSTANTE,' ')
            OR
            nvl(A.TIPO_SOTTOSTANTE, ' ') != nvl(B.TIPO_SOTTOSTANTE,' ')
            OR
            nvl(A.CEDOLA_LORDA_CORRENTE, 0) != nvl(B.CEDOLA_LORDA_CORRENTE, 0)
            OR
            nvl(A.FREQUENZA_CEDOLA, ' ') != nvl(B.FREQUENZA_CEDOLA, ' ')
            OR
            nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
            OR
            nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
            OR
            nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
            OR
            nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
            OR
            nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
            OR
            nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
            OR
            nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
            OR
            nvl(A.PRIMO_PREZZO_EMISSIONE, 0) != nvl(B.PRIMO_PREZZO_EMISSIONE, 0)
            OR
            nvl(A.MODALITA_RIMBORSO, 0) != nvl(B.MODALITA_RIMBORSO, 0)
            OR
            nvl(A.SUBORDINAZIONE, ' ') != nvl(B.SUBORDINAZIONE, ' ')
            OR
            nvl(A.DIV_EMIS_CODE, 0) != nvl(B.DIV_EMIS_CODE, 0)
            OR
            nvl(A.DIV_EMIS, ' ') != nvl(B.DIV_EMIS, ' '))The new query that not works is:
    SELECT  rtrim('Cambio di: '
            || (CASE WHEN nvl(A.CODICE_EMITTENTE ,' ') <> nvl(B.CODICE_EMITTENTE ,' ') THEN 'Codice emittente, ' ELSE '' END)
            || (CASE WHEN nvl(A.DESCRIZIONE_TITOLO,' ') <> nvl(B.DESCRIZIONE_TITOLO,' ') THEN 'Descrizione titolo, ' ELSE '' END)
            || (CASE WHEN nvl(A.SOTTOSTANTE,' ') <> nvl(B.SOTTOSTANTE,' ') THEN 'Sottostante, ' ELSE '' END)
            || (CASE WHEN nvl(A.TIPO_SOTTOSTANTE, ' ') <> nvl(B.TIPO_SOTTOSTANTE,' ') THEN 'Tipo sottostante, ' ELSE '' END)
            || (CASE WHEN nvl(A.CEDOLA_LORDA_CORRENTE, 0) <> nvl(B.CEDOLA_LORDA_CORRENTE, 0) THEN 'Cedola lorda corrente, ' ELSE '' END)
            || (CASE WHEN nvl(A.FREQUENZA_CEDOLA, ' ') <> nvl(B.FREQUENZA_CEDOLA, ' ') THEN 'Frequenza cedola, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') THEN 'Data inizio facoltà call, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') THEN 'Data fine facoltà call, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') THEN 'Data inizio facoltà put, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') THEN 'Data fine facoltà put, ' ELSE '' END)
            || (CASE WHEN nvl(A.AMMONTARE_EMESSO, 0) <> nvl(B.AMMONTARE_EMESSO, 0) THEN 'Ammontare emesso, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') <> nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999') THEN 'Data primo godimento, ' ELSE '' END)
            || (CASE WHEN nvl(A.DATA_SCADENZA, '31-Dec-2999') <> nvl(B.DATA_SCADENZA, '31-Dec-2999') THEN 'Data scadenza, ' ELSE '' END)
            || (CASE WHEN nvl(A.PRIMO_PREZZO_EMISSIONE, 0) <> nvl(B.PRIMO_PREZZO_EMISSIONE, 0) THEN 'Primo prezzo di emissione, ' ELSE '' END)
            || (CASE WHEN nvl(A.MODALITA_RIMBORSO, 0) <> nvl(B.MODALITA_RIMBORSO, 0) THEN 'Modalità rimborso, ' ELSE '' END)
            || (CASE WHEN nvl(A.SUBORDINAZIONE, ' ') <> nvl(B.SUBORDINAZIONE, ' ') THEN 'Subordinazione, ' ELSE '' END)
            || (CASE WHEN nvl(A.DIV_EMIS_CODE, 0) <> nvl(B.DIV_EMIS_CODE, 0) THEN 'Codice divisa di emissione, ' ELSE '' END)
            || (CASE WHEN nvl(A.DIV_EMIS, ' ') <> nvl(B.DIV_EMIS, ' ') THEN 'Divisa di emissione, ' ELSE '' END)
            ,', ') TIPO_VARIAZIONE,
           A.ISICOD ,
           A.CODICE_EMITTENTE AS EMIT_COD_T, B.CODICE_EMITTENTE AS EMIT_COD_T1, 
           A.DESCRIZIONE_TITOLO AS DESC_TITOLO_T, B.DESCRIZIONE_TITOLO AS DESC_TITOLO_T1,
           A.SOTTOSTANTE AS SOTTOSTANTE_T, B.SOTTOSTANTE AS SOTTOSTANTE_T1,
           A.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T, B.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T1,
           A.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T, B.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T1,
           A.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T, B.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T1,
           A.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T, B.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T1,
           A.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T, B.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T1,
           A.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T, B.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T1,
           A.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T, B.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T1,
           A.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T, B.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T1,
           A.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T,  B.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T1,
           A.DATA_SCADENZA AS DATA_SCADENZA_T, B.DATA_SCADENZA AS DATA_SCADENZA_T1,
           A.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T, B.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T1,
           A.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T, B.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T1,
           A.SUBORDINAZIONE AS SUBORDINAZIONE_T, B.SUBORDINAZIONE AS SUBORDINAZIONE_T1,
           A.DIV_EMIS_CODE AS DIV_EMIS_CODE_T, B.DIV_EMIS_CODE AS DIV_EMIS_CODE_T1,
           A.DIV_EMIS AS DIV_EMIS_T, B.DIV_EMIS AS DIV_EMIS_T1,
           A.START_DATE AS DATA_AGG_T, B.START_DATE AS DATA_AGG_T1
    FROM SPR_KLERS_ISD A, SPR_KLERS_ISD B
    WHERE A.START_DATE=TRUNC(SYSDATE)
          AND A.ISICOD=B.ISICOD
          AND B.END_DATE = TRUNC(SYSDATE)
          AND (nvl(A.CODICE_EMITTENTE,' ') != nvl(B.CODICE_EMITTENTE,' ')
            OR
            nvl(A.DESCRIZIONE_TITOLO,' ') != nvl(B.DESCRIZIONE_TITOLO,' ')
            OR
            nvl(A.SOTTOSTANTE,' ') != nvl(B.SOTTOSTANTE,' ')
            OR
            nvl(A.TIPO_SOTTOSTANTE, ' ') != nvl(B.TIPO_SOTTOSTANTE,' ')
            OR
            nvl(A.CEDOLA_LORDA_CORRENTE, 0) != nvl(B.CEDOLA_LORDA_CORRENTE, 0)
            OR
            nvl(A.FREQUENZA_CEDOLA, ' ') != nvl(B.FREQUENZA_CEDOLA, ' ')
            OR
            nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
            OR
            nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
            OR
            nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
            OR
            nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
            OR
            nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
            OR
            nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
            OR
            nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
            OR
            nvl(A.PRIMO_PREZZO_EMISSIONE, 0) != nvl(B.PRIMO_PREZZO_EMISSIONE, 0)
            OR
            nvl(A.MODALITA_RIMBORSO, 0) != nvl(B.MODALITA_RIMBORSO, 0)
            OR
            nvl(A.SUBORDINAZIONE, ' ') != nvl(B.SUBORDINAZIONE, ' ')
            OR
            nvl(A.DIV_EMIS_CODE, 0) != nvl(B.DIV_EMIS_CODE, 0)
            OR
            nvl(A.DIV_EMIS, ' ') != nvl(B.DIV_EMIS, ' '))where I have changed only this:
    B.START_DATE = decode(trim(to_char(sysdate, 'Day')), 'Monday',trunc(sysdate-3), trunc(sysdate-1)) --------->AND B.END_DATE = TRUNC(SYSDATE)
    Both START_DATE and END_DATE are date filds.
    When I execute the second query I receive this:
    ORA-01843: not a valid monthin many ponts of the query that change every time I execute the query, why this behaviour?
    How can I solve?
    Thanks, bye bye.

    Could you execute the following query and post the output.
    select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
    select sysdate from dual;Also what are the datatypes for these columns
    >
    nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
    OR
    nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
    OR
    nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
    OR
    nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
    OR
    nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
    OR
    nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
    OR
    nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
    >
    I hope you know anything given in single quotes is a string and not a date.
    Regards
    Raj

  • Error - ORA-01843: NOT A VALID MONTH

    I get this Error when I execute a procedure which accepts input paramters to insert into a table. I tried using TO_DATE(Input_param,'MM/DD/YY') too but it still gives me the error. Plz. Help.

    > However if I make this modification in the values clause of the insert statement
    and if I dont used "TO_DATE" function in the procedure call its giving me the above error.
    SQL> values(
    ,TO_DATE(p_date,'DD/MM/YYYY'));
    I'm not clear what modification you are making to what. If p_date is a DATE, there should not be a TO_DATE conversion applied to it inside the procedure - it's already a DATE.
    How is your case different from the following example?
    SQL> CREATE TABLE testit
      2  ( id INTEGER, dateval DATE );
    Table created.
    SQL> CREATE OR REPLACE PROCEDURE testproc
      2     ( p_id INTEGER
      3     , p_dateval DATE )
      4  AS
      5  BEGIN
      6     INSERT INTO testit (id, dateval)
      7     VALUES (p_id, p_dateval);
      8  END testproc;
      9 /
    Procedure created.
    SQL> desc testproc
    PROCEDURE testproc
    Argument Name                  Type                    In/Out Default?
    P_ID                           NUMBER(38)              IN
    P_DATEVAL                      DATE                    IN
    SQL> exec testproc(1, sysdate);
    PL/SQL procedure successfully completed.
    SQL> exec testproc(2, DATE '2006-03-24');
    PL/SQL procedure successfully completed.
    SQL> exec testproc (3, TO_DATE('23/03/2006','DD/MM/YYYY'))
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM testit;
            ID DATEVAL
             1 24-MAR-2006
             2 24-MAR-2006
             3 23-MAR-2006
    3 rows selected.If the procedure parameter is a DATE and the column is also a DATE, there should be no conversion involved. The "Not a valid month" error occurs when you try to convert a string to a DATE using either the wrong format or a nonsense string such as '2005-94-01'. You need to be clear what is a DATE and what is a string at each stage of processing.
    Notice that the default date format can be changed:
    SQL> ALTER SESSION SET nls_date_format = 'YYYY-MM-DD';
    Session altered.
    SQL> SELECT * FROM testit;
            ID DATEVAL
             1 2006-03-24
             2 2006-03-24
             3 2006-03-23
    3 rows selected.
    SQL> ALTER SESSION SET nls_date_format = 'RRRR-MM-DD HH24:MI:SS';
    Session altered.
    SQL> SELECT * FROM testit;
            ID DATEVAL
             1 2006-03-24 11:55:45
             2 2006-03-24 00:00:00
             3 2006-03-23 00:00:00
    3 rows selected.

  • Query Builder session settings as a solve to ORA-01843 (not a valid month)

    Hi All! I'm novice at Oracle and RDBMS, so sorry for a dummy question.
    I'm trying to make some queries to a tutorial database (10g XE) with Query Builder of Application Express 2.1000039.
    I'm requesting columns with id, date of order and status of order; in a column of ordering date as a "where" condition I've wrote:
    >= to_date('23-JUN-2006', 'DD-MON-RRRR') and got an error "ORA-01843: not a valid month".
    Then I've edited row filtering condition:
    >= to_date('23-JUN-2006', 'DD-MON-RRRR', 'NLS_DATE_LANGUAGE = american') and 've got a correct query result, BUT resulting table date format is DD-MM-RR.
    So, here is a couple of questions:
    1. Can I change a session settings (e.g. alter session set NLS_DATE_FORMAT = 'DD-MON-RRRR') such way, to use it in Query Builder, before building an application itself and not to write 'NLS_DATE_LANGUAGE = american' every time I'm inserting data to a date datatype field?
    2. I wonder why resulting table date format is 'DD-MM-RRRR'. How can I get a data exactly in a date format 'DD-MON-RRRR', how I'm specifying in a query?
    My operating system is Windows 7 Home Basic, NLS_DATE_FORMAT is DD-MON-YYYY in 2 cases in register and respectively in environment variable.
    SQL*Plus displays all mentionted query tables correctly, corresponding to an 'ALTER SESSION ..... SETTINGS'.
    Hope to your help, guys. Thanks for answers!

    Hi,
    you can run the following query so you will see the session parameter values, and any differences with database and instance values :
    SELECT
      a1.parameter as "Parameter",
      a1.value as "Database value",
      a2.value as "Instance value",
      a3.value as "Session value"
    FROM
      nls_database_parameters a1
      LEFT JOIN nls_instance_parameters a2 ON a1.parameter = a2.parameter
      LEFT JOIN nls_session_parameters a3 ON a1.parameter = a3.parameter
    ORDER BY
      a1.parameter ASC;What are the values for NLS_DATE_LANGUAGE and NLS_DATE_FORMAT ?
    1. Can I change a session settings such way, to use it in Query Builder, before building an application itself and not to write 'NLS_DATE_LANGUAGE = american' every time I'm inserting data to a date datatype field?In the application, It depends on the Application Primary Language and Application Date Format you have set in the application globalization attributes. But you can also alter the session every time the APEX engine connects to the database, by entering some PL/SQL code in the Initialization PL/SQL Code attribute of the application (Application Builder -> Application -> Edit Security Attributes) :
    BEGIN
       EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_DATE_LANGUAGE = ''AMERICAN'' ';
    END;In all cases application level settings will only affect the application, not SQL Commands and Query Builder. I think you have to alter session manually each time for these two last tools :/

  • Getting ORA-01843 not a valid month on '12/15/2001'

    i'm simply trying to enter data into data which has date columns.
    table
    col1 varchar
    col2 varchar
    col3 date
    insert into table
    (col1,col2,col3)
    values
    ('1','2', '12/14/2001')
    but i receive an error ora-01843, not a valid month, on the statement, but if i substitute the date string with sysdate all works fine.
    what am i missing?

    Always use TO_DATE for dates.
    So instead of '12/14/2001', you should use TO_DATE('12/14/2001', 'MM/DD/YYYY')

  • XMLTable default values for timestamp results in ORA-01843: not a valid month

    When I try to provide a default for a timestamp value in the XMLTABLE function, I am greeted with an error - ORA-01843: not a valid month - no matter how I provide that default value. Whether there is a value present in the XML or not is irrelavant for this bug to occur. It appears to be an incomplete fix of bug number 9745897 (thread).
    select x.*
    from
    xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
      COLUMNS dt timestamp default sysdate) x;
    select x.*
    from
    xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
      COLUMNS dt timestamp default systimestamp) x;
    select x.*
    from
    xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
      COLUMNS dt timestamp default to_char(systimestamp, 'YYYY-MM-DD"T"HH24:MI:SS') ) x;
    Edit: A little more followup.
    This works:
    select x.*
    from
    xmltable('/DOC' passing xmltype('<DOC></DOC>')
      COLUMNS dt date default sysdate) x;
    This also works, except for its just the date, and not the date/time
    select x.*
    from
    xmltable('/DOC' passing xmltype('<DOC></DOC>')
      COLUMNS dt timestamp default sysdate) x;
    This doesn't work
    select x.*
    from
    xmltable('/DOC' passing xmltype('<DOC></DOC>')
      COLUMNS dt timestamp default systimestamp) x;
    ORA-01861: literal does not match format string

    Hi,
    First of all, let's check the manual for the DEFAULT clause :
    XMLTABLE SQL/XML Function in Oracle XML DB
    The optional DEFAULT clause specifies the value to use when the PATH expression results in an empty sequence (or NULL). Its expr is an XQuery expression that is evaluated to produce the default value.
    According to the documentation, the DEFAULT clause should specify an XQuery expression.
    However, that is wrong, the actual implementation only expects an expression that resolves to a string, the content is not interpreted.
    So, bottom line is if we don't directly specify a string, the expression will be implicitly converted to one, and we all know how bad things can go when implicit conversions occur, especially when dates or timestamps are involved.
    Now let's focus on how the DEFAULT clause affects the query evaluation.
    When a DEFAULT clause is specified, Oracle rewrites the projection differently and do not use the native xs:dateTime format to convert the value  :
    select x.*
    from
    xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
      COLUMNS dt timestamp default systimestamp
      ) x
    becomes :
    SELECT CASE EXISTSNODE(VALUE(KOKBF$),'/DOC/DT')
             WHEN 1 THEN CAST(TO_TIMESTAMP(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(SYS_XQEXTRACT(VALUE(KOKBF$),'/DOC/DT')),50,1,2)) AS timestamp )
             ELSE CAST(TO_TIMESTAMP(TO_CHAR(SYSTIMESTAMP(6)),'SYYYY-MM-DD"T"HH24:MI:SSXFF') AS timestamp )
           END  "DT"
    FROM TABLE("SYS"."XQSEQUENCE"(EXTRACT("SYS"."XMLTYPE"('<DOC><DT>2013-08-14T15:08:31</DT></DOC>'),'/DOC'))) "KOKBF$"
    See the red part : it doesn't use the format parameter, so the conversion relies on the session's NLS settings.
    When there's no DEFAULT clause, the TO_TIMESTAMP function uses an explicit format :
    select x.*
    from
    xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
      COLUMNS dt timestamp --default systimestamp
      ) x
    rewritten to :
    SELECT CAST(
             TO_TIMESTAMP(
               SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(SYS_XQEXTRACT(VALUE(KOKBF$),'/DOC/DT'),0,0,20971520,0),50,1,2)
             , 'SYYYY-MM-DD"T"HH24:MI:SSXFF'
             AS timestamp --default systimestamp
           ) "DT"
    FROM TABLE("SYS"."XQSEQUENCE"(EXTRACT("SYS"."XMLTYPE"('<DOC><DT>2013-08-14T15:08:31</DT></DOC>'),'/DOC'))) "KOKBF$"
    so yes, maybe there's a bug here.
    Edit: A little more followup.
    This works:
    select x.*
    from
    xmltable('/DOC' passing xmltype('<DOC></DOC>')
      COLUMNS dt date default sysdate) x;
    Actually no, it doesn't work. Granted, maybe it doesn't produce any error, but the result is incorrect.
    As explained, the conversion relies on the session NLS (NLS_DATE_FORMAT in this case) :
    SQL> show parameters nls_date_format
    NAME                                 TYPE        VALUE
    nls_date_format                      string      DD/MM/RR
    SQL>
    SQL> select sysdate from dual;
    SYSDATE
    16/08/13
    SQL> select x.*
      2  from
      3  xmltable('/DOC' passing xmltype('<DOC></DOC>')
      4    COLUMNS dt date default sysdate) x;
    DT
    13/08/16
    Oracle first converts SYSDATE to a string using current NLS_DATE_FORMAT, resulting in '16/08/13'
    Then this string is converted to a DATE using the xs:date format 'YYYY-MM-DD' resulting in 13/08/0016 (August 13, 0016) which is incorrect.
    The obvious workaround to this issue is to control how Oracle implicitly converts from string to date/timestamp format :
    SQL> alter session set NLS_TIMESTAMP_FORMAT= 'YYYY-MM-DD"T"HH24:MI:SS';
    Session altered.
    SQL> select x.*
      2  from
      3  xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
      4    COLUMNS dt timestamp default systimestamp
      5    ) x;
    DT
    2013-08-14T15:08:31
    SQL> select x.*
      2  from
      3  xmltable('/DOC' passing xmltype('<DOC></DOC>')
      4    COLUMNS dt timestamp default systimestamp) x;
      COLUMNS dt timestamp default systimestamp) x
    ERROR at line 4:
    ORA-01861: literal does not match format string
    SQL> select x.*
      2  from
      3  xmltable('/DOC' passing xmltype('<DOC></DOC>')
      4    COLUMNS dt timestamp default cast(systimestamp as timestamp)) x;
    DT
    2013-08-16T12:32:58

  • The database error text is: ORA-01843: not a valid month

    I am trying to use a date field as a query filter and I keep getting the
    following error:
    A database error occurred. The database error text is: ORA-01843: not a
    valid month. (WIS 10901).
    When I remove the query filter and run the query it works as
    expected. I want to be able to allow the users to use the date field in order
    to select a date range. Can someone provide me with some information on how to
    resolve this issue.

    SQL> SELECT (to_char(tO_date('09/29/2006', 'mm/dd/yyyy'))||':'||TO_CHAR(systimestamp,'hh24:mi:ss:ff6'))
      2  FROM dual;
    (TO_CHAR(TO_DATE('09/29/2006
    29-SEP-06:01:33:09:023000
    But you want mm/dd/yyyy hh24:mi:ss:ff6 format then use TO_CHAR function for format specifier
    SQL> SELECT to_char(to_timestamp((to_char(tO_date('09/29/2006', 'mm/dd/yyyy'))||':'||TO_CHAR(systimestamp,'hh24:mi:ss:ff6')), 'dd/mm/yyyy hh24:mi:ss:ff6'),'mm/dd/yyyy hh24:mi:ss:ff6')
      2  FROM DUAL
      3  /
    TO_CHAR(TO_TIMESTAMP((TO_CHAR
    09/29/0006 01:40:27:113000
    SQL> Khurram

  • M_View failed inrefresh throws error: ORA-12008/ORA-01843:not a valid month

    I am not able to refresh this matrialized view in 2 databases.Can some one help please
    ======================================================
    SQL> exec dbms_refresh.refresh('OID_SYNCH.OID_SYNCH_EMPLOYEES_HR');
    BEGIN dbms_refresh.refresh('OID_SYNCH.OID_SYNCH_EMPLOYEES_HR'); END;
    ERROR at line 1:
    ORA-12008: error in materialized view refresh path
    ORA-01843: not a valid month
    ORA-02063: preceding line from HR
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2251
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2457
    ORA-06512: at "SYS.DBMS_IREFRESH", line 685
    ORA-06512: at "SYS.DBMS_REFRESH", line 195
    ORA-06512: at line 1
    ======================================
    DDL of Matrialized view is as:
    CREATE MATERIALIZED VIEW "OID_SYNCH"."OID_SYNCH_EMPLOYEES_HR" ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "OID_SYNCH_D" BUILD IMMEDIATE USING INDEX REFRESH COMPLETE ON DEMAND START WITH sysdate+0 NEXT trunc(sysdate + 1) USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE AS ( select hr_person_id, hr_employee_status, hr_employee_number,hr_workbrain_id, hr_last_name, hr_first_name, hr_full_name,
    hr_known_as, hr_middle_names, hr_previous_last_name,hr_suffix, hr_email_address, hr_user_name,system_person_type, user_person_type, hr_start_date, hr_last_update_date,home_city, home_state, home_zip, home_country,home_last_update_date,position_name, job_name,work_location_code, work_location_desc,work_city, work_state, work_zip,work_country,work_last_update_date,hr_supervisor_name,hr_supervisor_id,hr_sup_last_update_date,termination_date
    from oid_synch_employees@hr )

    >
    I am not able to refresh this matrialized view in 2 databases.Can some one help please
    >
    Post the ddl for the source table.
    Also do a test. Create a table that is a clone of the MV table. Then try to do an INSERT INTO SELECT * FROM the source table into the clone table and see if you get an error.
    Don't forget to post the 4 digit Oracle versions of the source and target databases.

  • Getting Ora 01843  not a Valid month Error

    Hi
    I was trying to assign the data in MM/DD/YY format
    from a date value '09/25/2009'..
    I cannot Obain the result i always get this
    ORA-01843: not a valid month
    May i ask you kindly to help me out here.
    Below is the code Snippet;
    DECLARE
    lv_date DATE;
    BEGIN
    lv_date := '09/25/2009';
    BEGIN
    lv_date:= TO_DATE(lv_date,'MM/DD/YY');
    lv_date:= TO_CHAR(lv_date,'MM/DD/YY');
    -- I slso tried this way but same error.
    -- lv_date := TO_CHAR(TO_DATE(lv_date,'MM/DD/YYYY'),'MM/DD/YY');
    END;
    DBMS_OUTPUT.PUT_LINE('the date format is = '|| lv_date);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE ('Err from MainBlock '|| SQLCODE || SQLERRM);
    END;

    Hi,
    1)
    lv_date := '09/25/2009';lv_date is a variable of datatype date, but you are assigning a varchar, which Oracle is not able to do implicit conversion because of nls_date_format
    change to something like to_date('09/25/2009','mm/dd/yyyy')
    2)
    lv_date:= TO_DATE(lv_date,'MM/DD/YY');
    lv_date:= TO_CHAR(lv_date,'MM/DD/YY');Why would be assinging a char value to date datatype. Use any one depending on datatype of lv_date
    Regards
    Anurag Tibrewal.

  • JBO-27122: SQL error & java.sql.SQLException: ORA-01843: not a valid month

    Hi,
    We developed OA page for Employee's Payslip and it is working fine for all the employees but it is not working for only one employee...Getting the error as
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement
    preparation
    ## Detail 0 ##
    java.sql.SQLException: ORA-01843: not a valid month
    Real Scenario is:
    The user "DANISH.LOTFY" is login into application and when he click on Payslip to the month then he is always getting the above error.
    For testing purpose we have removed his employee assignment from user screen(fnd_user) and assigned some other employee name (say MOHAMED.ELBAHY)... After this when DANISH.LOTFY logins into the application and payslip page is working fine...(He can able to see MOHAMED.ELBAHY payslip.....
    Realy we don't know this strange behaviour of OA ...
    ------ Code with Error details------------------
    Statement:
    SELECT * FROM (SELECT DISTINCT ppa.DATE_EARNED, TO_CHAR(ppa.DATE_EARNED,'MON-YYYY') DISPLAY
    , TO_CHAR(ppa.DATE_EARNED,'MM YYYY') PARAM
    FROM
    pay_payroll_actions ppa
    ,pay_assignment_actions pac
    ,PER_ALL_ASSIGNMENTS_F PASS
    ,FND_USER FU
    ,per_time_periods PTP
    WHERE ppa.payroll_id = 61
    AND ppa.payroll_action_id = pac.payroll_action_id
    AND PAC.ASSIGNMENT_ID = PASS.ASSIGNMENT_ID
    AND PASS.PERSON_ID = FU.EMPLOYEE_ID
    AND FU.USER_ID =Fnd_Profile.VALUE('USER_ID')
    AND TRIM(TO_CHAR(ppa.DATE_EARNED,'MON-YYYY')) IS NOT NULL
    ---Added by Sudipta C on 28th Janaury 2008
    AND TRIM(TO_CHAR(ppa.DATE_EARNED,'MON-YYYY')) <> TRIM(TO_CHAR(SYSDATE,'MON-YYYY'))
    AND ppa.DATE_EARNED=(SELECT MAX(DATE_EARNED) FROM pay_payroll_actions WHERE time_period_id=ppa.time_period_id)
    AND ppa.DATE_EARNED >='30-NOV-2007'
    UNION ALL
    --Query to Display only the Current Month if the Concurrent Request Ran
    SELECT DISTINCT ppa.DATE_EARNED, TO_CHAR(ppa.DATE_EARNED,'MON-YYYY') DISPLAY
    , TO_CHAR(ppa.DATE_EARNED,'MM YYYY') PARAM
    FROM
    pay_payroll_actions ppa
    ,pay_assignment_actions pac
    ,PER_ALL_ASSIGNMENTS_F PASS
    ,FND_USER FU
    ,per_time_periods PTP
    WHERE ppa.payroll_id = 61
    AND ppa.payroll_action_id = pac.payroll_action_id
    AND PAC.ASSIGNMENT_ID = PASS.ASSIGNMENT_ID
    AND PASS.PERSON_ID = FU.EMPLOYEE_ID
    AND FU.USER_ID = Fnd_Profile.VALUE('USER_ID')
    AND TRIM(TO_CHAR(ppa.DATE_EARNED,'MON-YYYY')) IS NOT NULL
    AND TRIM(TO_CHAR(ppa.DATE_EARNED,'MON-YYYY')) = TRIM(TO_CHAR(SYSDATE,'MON-YYYY'))
    AND ppa.DATE_EARNED=(SELECT MAX(DATE_EARNED) FROM pay_payroll_actions WHERE time_period_id=ppa.time_period_id)
    AND ppa.DATE_EARNED >='30-NOV-2007'
    --Check the Concurrent Program Ran or not to Display the SYS Month Payroll Period ID
    AND EXISTS
    (SELECT TRIM(TO_CHAR(REQUEST_DATE,'MON-YYYY')) FROM fnd_conc_req_summary_v fcrs
    WHERE program_short_name = 'PROC_EXP1_TESTING'
    AND PHASE_CODE='C' AND STATUS_CODE='C'
    AND TO_CHAR(REQUEST_DATE,'MON-YYYY')=TO_CHAR(SYSDATE,'MON-YYYY')
    AND REQUEST_DATE=(SELECT MAX(REQUEST_DATE) FROM fnd_conc_req_summary_v
    WHERE CONCURRENT_PROGRAM_ID=fcrs.CONCURRENT_PROGRAM_ID))
    ORDER BY 1 DESC) QRSLT WHERE (( UPPER(DISPLAY) like :1 AND (DISPLAY like :2 OR DISPLAY like :3 OR DISPLAY like :4 OR DISPLAY like :5)))
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormData(OAPageBean.java:2555)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1677)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
         at oa_html._OA._jspService(_OA.java:84)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01843: not a valid month
    Could any please suggest/provide your valuable inputs to resolve this issue(It is in production , so please treat it as very urgent).
    Thanks & Regards,
    J.Prakash

    Hi,
    This is really a strange behaviour as you are saying that it is happening only for one user so please check his user preferences.
    Regards,
    Reetesh Sharma

  • ERROR java.sql.SQLException: ORA-01843: not a valid month

    This page is working fine for English Language. Once we change preference Lanuage to "French Candian" We are getting this issue.
    This is little urgent on this.
    ERROR
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: select
    ppf.person_id,
    ppf.employee_number,
    god.organization_id,
    ppf.full_name employee_name,
    (select full_name from per_people_x where person_id = paf.supervisor_ID ) manager_name,
    (select full_name from per_people_x where person_id = haou.attribute4 ) hr_name,
    --hr_general.decode_person_name(haou.attribute4 ) hr_name,
    haou.name organization_name,
    GEM.termination_date actual_termination_date,
    (select meaning from hr_lookups where lookup_type = 'LEAV_REAS' and lookup_code = GEM.Leaving_reason and enabled_flag = 'Y') leaving_reason,
    god.sub_business sub_business,
    god.business_segment business_segment,
    god.industry_focus_group industry_focus_group,
    pgd.segment2 corporate_Band,
    tl.territory_short_name country
    from per_people_f ppf,
    per_assignments_f paf,
    hr_all_organization_units haou,
    per_grades pg,
    per_grade_definitions pgd,
    per_addresses pa,
    fnd_territories_tl tl,
    XXsm_org_dtl god,
    XX_EXIT_TRANSACTION GET,
    XX_EXIT_MANAGER GEM
    where 1=1
    and paf.person_id=:1
    and paf.primary_flag='Y'
    and ppf.person_id = paf.person_id
    and paf.organization_id=haou.organization_id
    and paf.organization_id = god.organization_id
    and trunc(sysdate) between trunc(paf.effective_start_date) and trunc(paf.effective_end_date)
    and trunc(sysdate) between trunc(ppf.effective_start_date) and trunc(ppf.effective_end_date)
    and ppf.person_id=GET.employee_id(+)
    and GET.Transaction_id = GEM.transaction_id
    and paf.grade_id=pg.grade_id(+)
    and pg.grade_definition_id=pgd.grade_definition_id(+)
    and ppf.person_id=pa.person_id(+)
    and pa.primary_flag(+)='Y'
    and pa.country=tl.territory_code(+)
    AND tl.language = USERENV('LANG')
    AND trunc(sysdate) between trunc(pa.Date_from) and trunc(nvl(pa.Date_to, TO_DATE ('31-DEC-4712', 'DD-MON-YYYY')))
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:865)
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:988)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:211)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:153)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:750)
         at ge.oracle.apps.per.selfservice.eexit.employee.webui.GEExitEmployeeCO.processRequest(GEExitEmployeeCO.java:112)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2348)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1747)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:511)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:432)
         at oa_html._OA._jspService(_OA.java:84)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:619)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01843: not a valid month
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:590)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1973)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1119)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2566)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2963)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:658)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:584)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:631)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:518)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3375)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:828)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4507)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)
         at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)
         at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3339)
         at oracle.jbo.server.ViewObjectImpl

    Are you hard coding anything in code or VO ?
    AND trunc(sysdate) between trunc(pa.Date_from) and trunc(nvl(pa.Date_to, TO_DATE ('31-DEC-4712', 'DD-MON-YYYY')))Try some modification in the above nvl code and test.
    And refer:
    http://apps2fusion.com/apps/apps/430-string-to-date
    -Anand

Maybe you are looking for