Throwing not a valid month error(ORA-01843)

Hi,
Can you please tell me whats wrong with the statement
select Fas_Rpt_Disclose_Summ_Pkg.F_EXR_COLUMN_VALUES(3,5207773,TO_DATE('28-JUN-06','DD-MON-YY'),TO_DATE('26-Sep-06','DD-MON-YY'),TO_DATE('26-SEP-06:23:59:59','DD-MON-YY:HH24:MI:SS'),'INTRINSICVALEXR') from dual;
Thanks

What is the current value of NLS_DATE_LANGUAGE?
SQL> alter session set nls_date_language='ENGLISH';
Session altered.
SQL> select TO_DATE('28-JUN-06','DD-MON-YY'),
  2         TO_DATE('26-Sep-06','DD-MON-YY'),
  3         TO_DATE('26-SEP-06:23:59:59','DD-MON-YY:HH24:MI:SS')
  4  from dual;
TO_DATE(' TO_DATE(' TO_DATE('
28-JUN-06 26-SEP-06 26-SEP-06
SQL> alter session set nls_date_language='FRENCH';
Session altered.
SQL> select TO_DATE('28-JUN-06','DD-MON-YY'),
  2         TO_DATE('26-Sep-06','DD-MON-YY'),
  3         TO_DATE('26-SEP-06:23:59:59','DD-MON-YY:HH24:MI:SS')
  4  from dual;
select TO_DATE('28-JUN-06','DD-MON-YY'),
ERROR at line 1:
ORA-01843: not a valid month
SQL>

Similar Messages

  • Not valid month Error Ora 01843

    hi
    This is an error while running a report 6i. in Oracle 8i Environment.
    "Not valid month Error Ora 01843"
    This report is working fine in Production. But it is not working in Development Database.
    Development database is the image of Production system.
    Any reason for this Error?

    Dear Naseer C ,
    We got similar experiences for several time.
    We quried like that.
    Selet moth from table;
    08-AUG-1988
    08-08-1988
    08-08-88
    We changed several time until diappear the message.
    Hopefully, it will help you.
    Best regards,
    S!G

  • How to solve ORA-01843: not a valid month error

    i am gettion ORA-01843: not a valid month error how to solve it. and how to find which record causing
    proble.
    Thanks in advance.

    EdStevens wrote:
    Ramin Hashimzadeh wrote:
    user1571313 wrote:
    i am gettion ORA-01843: not a valid month error how to solve it. and how to find which record causing
    proble.
    Thanks in advance.Bring for me something from somewhere... :)Bring me a shrubbery.
    When you have found the shrubbery, then you must cut down the mightiest tree in the forest ... with a herring.We are no longer the knights who say ni! We are now the knights who say "i am gettion ORA-01843"!

  • ORA-01843 Not a valid month Error

    Dear all,
    We did a database upgrade from 9.2.0.1 to 11gR2 and after that everything is working fine.
    But now we noticed that the users are getting ORA-01843 Not a valid month Error.
    I changed the NLS_DATE_FORMAT in the init.ora file, but still the error persist.
    As a work around I changed the NLS_DATE_FORMAT=DD-MM-YYYY on the client pc registry and now its working in that pc..
    Is there any other way so that the change gets affected globally ??
    Any tips
    Thanks in adv,
    Mahesh

    mahesh wrote:
    Dear all,
    We did a database upgrade from 9.2.0.1 to 11gR2 and after that everything is working fine.
    But now we noticed that the users are getting ORA-01843 Not a valid month Error.
    I changed the NLS_DATE_FORMAT in the init.ora file, but still the error persist.
    As a work around I changed the NLS_DATE_FORMAT=DD-MM-YYYY on the client pc registry and now its working in that pc..
    Is there any other way so that the change gets affected globally ??
    Any tips
    Thanks in adv,
    MaheshNLS_DATE_FORMAT can be set in multiple places, but it's not an either/or situation. Setting it in an init parm at the db level is the WEAKEST setting. That setting is overridden by the client OS, which in turn can be overridden by an ALTER SESSION, which in turn can be overridden by use of TO_CHAR and TO_DATE at the individual sql statement. and if the date is being entered by a human at a keyboard (actually keyed in, not picked from a calendar tool or some sort of drop-down pick list) you really have no direct control over the format of the string they key in. So ultimately it is up to the application to insure that character strings presented as dates are in the correct format.
    Which is why I advise developers to ALWAYS use to_char and to_date at the sql statement level. It is the only way they can insure control over the setting.

  • Period Comparison - getting not a valid month error

    I am trying to do a period comparison. I have the query condition as
    select ppv.draft_invoice_num
    ,ppv.ra_invoice_number
    ,ppv.invoice_date
    , idv.expenditure_item_date
    ,ppv.gl_date
    ,ppv.gl_period
    ,to_date(ppv.gl_period,'MON-YY')
    --,idv.bill_amount
    -- ,ppv.org_id
    from pa_proj_invoices_view ppv
    ,pa_proj_invoice_details_view idv
    where ppv.project_id= idv.project_id
    and ppv.draft_invoice_num = idv.draft_invoice_num
    and ppv.project_id = 25
    and idv.expenditure_item_date between '01-MAR-09' and '30-APR-09'
    and to_date(ppv.gl_period,'MON-YY') between to_date('MAR-09','MON-YY') and last_day(to_date('MAY-09','MON-YY'))
    group by ppv.draft_invoice_num
    ,ppv.ra_invoice_number
    ,ppv.invoice_date
    , idv.expenditure_item_date
    ,ppv.gl_date
    ,ppv.gl_period
    order by ppv.draft_invoice_num;
    I get an "Not a Valid Month" error. How can I do the date comparison? I have tried number of options . How can I compare the ppv.gl_period for a range of periods?
    Thanks

    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.

  • 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.

  • ORA-01843:This is not a valid month error

    One of our french customer using Oracle 11g R2 on RHEL is getting following error while running a stored procedure:
    ORA-01843: ce n'est pas un mois valide
    20120123::05:41:10 ended rebuilding cmroll table
    The error reported by ORACLE, in French « ce n'est pas un mois valide », means : « This is not a valid month ».I have asked him to verify the following settings on his machine:
    Please run the following query on Oracle Server to get the NLS settings. It specifies the settings both on Oracle client and Server.
    select * from nls_database_parameters;
    select * from nls_instance_parameters;
    However, you can override this setting by specifying the following environment variables in client or server. So kindly verify them  on both as well:
    1.     NLS_LANG
    2.     NLS_LANGUAGE
    3.     NLS_TERRITORYIs there anything further that can help me to trace this error?

    Moazzam wrote:
    ORA-01843: ce n'est pas un mois valide
    Is there anything further that can help me to trace this error?ORA-01843 Sounds a LOT more interesting in French :)
    I have to agree with the others that there is a problem with the code somewhere - again, the implicit conversion sounds promising. Or possibly a language issue (hopefully not)
    You should be getting a line number where the error is occurring. This can sometimes be deceptive; we use a WHEN-OTHERS exception handler but mark the code with a location marker throughout so we can look up errors and their locations in an exceptions table - in other words, the line cited in the error message may/may not be where the error happened. 11g sometimes reports errors on block headers too. There are other ways of finding the line the error is occurring on too, including just looking at the code (which is usually harder). Start by finding the line the error is occurring at.
    The "brute force" approach (if possible find an easier way) is to either use the debugger in a GUI tool or use DBMS_OUTPUT.PUT_LINE to trace your way through executions.
    When you find out where the error is occurring you can use DBMS_OUTPUT.PUT_LINE to display the value, find out what it is, and figure out what is causing the error, and fix it.
    Edited by: riedelme on Mar 13, 2012 7:11 AM

  • Replicat abends with "not a valid month"  error

    Here is what i see in the log:
    2015-04-16 14:02:21  ERROR   OGG-00665  OCI Error Flushing database inbound server, 'OGG$REP02' (status = 26815-ORA-26815: Error from Apply Network Receiver for Apply "OGG$REP02" and Capture "replicat".
    ORA-01843: not a valid month), SQL<select status, deferrable from dba_constraints where owner =UPPER('PRIME') and table_name=UPPER('FGCTRXNMESSAGERULES') and constraint_type = 'P' >.
    My replicat is integrated with parallelism set to 4.
    How can i find the error? Thanks.

    Hi ,
    Could you please share the extract and replicat parameter's contents?
    What is the version of GG you are using?
    Did you check the Character set of both source and target?
    Regards,
    Veera

  • Not a valid month error..

    Hello all,
    I have a nagging problem with front end code. I have got stored procedure written which runs perfectly fine when called from oracle Pl/SQL developer. But when the same procedure is called from .Net application it throws the following exception.
    ************Exception message****************
    "not a valid month"
    ************Exception message End****************
    ************Stored procedure code****************
    PROCEDURE getall_by_date
    P_DATE IN DATE,
    EVENT_FREQUENCY IN NVARCHAR2,
    CRM_EVENTS_RECORDS OUT SYS_REFCURSOR
    IS
    BEGIN
    IF LOWER(EVENT_FREQUENCY) = 'day(s)' THEN
    OPEN CRM_EVENTS_RECORDS FOR
    SELECT
    CRM_EVENTS.ID,
    CRM_EVENTS.EVENT_NAME,
    CRM_EVENTS.EVENT_TYPE,
    CRM_EVENTS.PUBLIC_VIEW,
    CRM_EVENTS.LOCATION,
    CRM_EVENTS.STATUS,
    CRM_EVENTS.PRIORITY,
    CRM_EVENTS.DESCRIPTION AS E_DESCRIPTION,
    CRM_EVENTS.SEND_NOTIFICATION,
    CRM_EVENTS.START_DATE,
    CRM_EVENTS.END_DATE,
    CRM_EVENTS.EVENT_DAYS,
    CRM_EVENTS.EVENT_HOURS,
    CRM_EVENTS.EVENT_MINUTES,
    CRM_RECURRINGEVENTS.ID,
    CRM_RECURRINGEVENTS.RECURRINGDATE,
    CRM_RECURRINGEVENTS.REMINDER_SENT,
    CRM_RECURRINGEVENTS.REMINDER_TIME
    FROM
    CRM_EVENTS, CRM_RECURRINGEVENTS
    WHERE
    TO_DATE(TO_CHAR(TO_TIMESTAMP(CRM_RECURRINGEVENTS.RECURRINGDATE,'DD-MM-YYYY HH:MI:SS.FF AM'),'DD-MM-YYYY'),'DD-MM-YYYY') = to_Date(P_DATE,'DD-MM-YYYY')
    AND
    CRM_RECURRINGEVENTS.CRM_EVENTS_ID = CRM_EVENTS.ID
    ORDER BY
    CRM_RECURRINGEVENTS.RECURRINGDATE DESC;
    ELSIF LOWER(EVENT_FREQUENCY) = 'month(s)' THEN
    OPEN CRM_EVENTS_RECORDS FOR
    SELECT
    CRM_EVENTS.ID,
    CRM_EVENTS.EVENT_NAME,
    CRM_EVENTS.EVENT_TYPE,
    CRM_EVENTS.PUBLIC_VIEW,
    CRM_EVENTS.LOCATION,
    CRM_EVENTS.STATUS,
    CRM_EVENTS.PRIORITY,
    CRM_EVENTS.DESCRIPTION AS E_DESCRIPTION,
    CRM_EVENTS.SEND_NOTIFICATION,
    CRM_EVENTS.START_DATE,
    CRM_EVENTS.END_DATE,
    CRM_EVENTS.EVENT_DAYS,
    CRM_EVENTS.EVENT_HOURS,
    CRM_EVENTS.EVENT_MINUTES,
    CRM_RECURRINGEVENTS.ID,
    CRM_RECURRINGEVENTS.RECURRINGDATE,
    CRM_RECURRINGEVENTS.REMINDER_SENT,
    CRM_RECURRINGEVENTS.REMINDER_TIME
    FROM
    CRM_EVENTS, CRM_RECURRINGEVENTS
    WHERE
    TO_CHAR(CRM_RECURRINGEVENTS.RECURRINGDATE,'MM') = TO_CHAR(TO_DATE(P_DATE,'DD-MM-YYYY'),'MM')
    AND
    CRM_RECURRINGEVENTS.CRM_EVENTS_ID = CRM_EVENTS.ID
    ORDER BY
    CRM_RECURRINGEVENTS.RECURRINGDATE DESC;
    ELSIF LOWER(EVENT_FREQUENCY) = 'year' THEN
    OPEN CRM_EVENTS_RECORDS FOR
    SELECT
    CRM_EVENTS.ID,
    CRM_EVENTS.EVENT_NAME,
    CRM_EVENTS.EVENT_TYPE,
    CRM_EVENTS.PUBLIC_VIEW,
    CRM_EVENTS.LOCATION,
    CRM_EVENTS.STATUS,
    CRM_EVENTS.PRIORITY,
    CRM_EVENTS.DESCRIPTION AS E_DESCRIPTION,
    CRM_EVENTS.SEND_NOTIFICATION,
    CRM_EVENTS.START_DATE,
    CRM_EVENTS.END_DATE,
    CRM_EVENTS.EVENT_DAYS,
    CRM_EVENTS.EVENT_HOURS,
    CRM_EVENTS.EVENT_MINUTES,
    CRM_RECURRINGEVENTS.ID,
    CRM_RECURRINGEVENTS.RECURRINGDATE,
    CRM_RECURRINGEVENTS.REMINDER_SENT,
    CRM_RECURRINGEVENTS.REMINDER_TIME
    FROM
    CRM_EVENTS, CRM_RECURRINGEVENTS
    WHERE
    TO_CHAR(CRM_RECURRINGEVENTS.RECURRINGDATE,'YYYY') = TO_CHAR(TO_DATE(P_DATE,'DD-MM-YYYY'),'YYYY')
    AND
    CRM_RECURRINGEVENTS.CRM_EVENTS_ID = CRM_EVENTS.ID
    ORDER BY
    CRM_RECURRINGEVENTS.RECURRINGDATE DESC;
    ELSIF LOWER(EVENT_FREQUENCY) = 'week(s)' THEN
    OPEN CRM_EVENTS_RECORDS FOR
    SELECT
    CRM_EVENTS.ID,
    CRM_EVENTS.EVENT_NAME,
    CRM_EVENTS.EVENT_TYPE,
    CRM_EVENTS.PUBLIC_VIEW,
    CRM_EVENTS.LOCATION,
    CRM_EVENTS.STATUS,
    CRM_EVENTS.PRIORITY,
    CRM_EVENTS.DESCRIPTION AS E_DESCRIPTION,
    CRM_EVENTS.SEND_NOTIFICATION,
    CRM_EVENTS.START_DATE,
    CRM_EVENTS.END_DATE,
    CRM_EVENTS.EVENT_DAYS,
    CRM_EVENTS.EVENT_HOURS,
    CRM_EVENTS.EVENT_MINUTES,
    CRM_RECURRINGEVENTS.ID,
    CRM_RECURRINGEVENTS.RECURRINGDATE,
    CRM_RECURRINGEVENTS.REMINDER_SENT,
    CRM_RECURRINGEVENTS.REMINDER_TIME
    FROM
    CRM_EVENTS, CRM_RECURRINGEVENTS
    WHERE
    TO_CHAR(CRM_RECURRINGEVENTS.RECURRINGDATE,'W') = TO_CHAR(TO_DATE(P_DATE,'DD-MM-YYYY'),'W')
    AND
    TO_CHAR(CRM_RECURRINGEVENTS.RECURRINGDATE,'MM') = TO_CHAR(TO_DATE(P_DATE,'DD-MM-YYYY'),'MM')
    AND
    TO_CHAR(CRM_RECURRINGEVENTS.RECURRINGDATE,'YYYY') = TO_CHAR(TO_DATE(P_DATE,'DD-MM-YYYY'),'YYYY')
    AND
    CRM_RECURRINGEVENTS.CRM_EVENTS_ID = CRM_EVENTS.ID
    ORDER BY
    CRM_RECURRINGEVENTS.RECURRINGDATE DESC;
    END IF;
    END;;
    ************Stored procedure code End****************
    ************C#.NET code****************
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    using System.Data;
    namespace BussLayer
    public class Event
    string eventName;
    string startDate;
    string endDate;
    int public_view;
    string priority;
    int EventType;
    int sendNotification;
    string location;
    int eventstatus;
    string description;
    int EventId;
    int on_every;
    string first_or_last;
    int day_of_month;
    string day_name;
    string repeat_frequency;
    int sun;
    int mon;
    int tue;
    int wed;
    int thu;
    int fri;
    int sat;
    int repeat_enabled;
    string single_date;
    string relatedType;
    int relatedToId;
    int Remind_Time_Days;
    int Remind_Time_Mins;
    int Remind_Time_Hrs;
    String pDate;
    String EVENT_FREQUENCY;
    public String p_Date
    get { return pDate; }
    set { pDate = value; }
    public String p_EVENT_FREQUENCY
    get { return EVENT_FREQUENCY; }
    set { EVENT_FREQUENCY = value; }
    public int p_Remind_Time_Hrs
    get { return Remind_Time_Hrs; }
    set { Remind_Time_Hrs = value; }
    public int p_Remind_Time_Mins
    get { return Remind_Time_Mins; }
    set { Remind_Time_Mins = value; }
    public int p_Remind_Time_Days
    get { return Remind_Time_Days; }
    set { Remind_Time_Days = value; }
    public int p_RelatedToId
    get { return relatedToId; }
    set { relatedToId = value; }
    public string p_relatedType
    get { return relatedType; }
    set { relatedType = value; }
    public string p_singleDate
    get { return single_date; }
    set { single_date = value; }
    public string p_endDate
    get { return endDate; }
    set { endDate = value; }
    public string p_startDate
    get { return startDate; }
    set { startDate = value; }
    public int p_on_every
    get { return on_every; }
    set { on_every = value; }
    public string p_first_or_last
    get { return first_or_last; }
    set { first_or_last = value; }
    public int p_day_of_month
    get { return day_of_month; }
    set { day_of_month = value; }
    public string p_day_name
    get { return day_name; }
    set { day_name = value; }
    public string p_repeat_freq
    get { return repeat_frequency; }
    set { repeat_frequency = value; }
    public int p_repeat_enabled
    get { return repeat_enabled; }
    set { repeat_enabled = value; }
    public int p_sat
    get { return sat; }
    set { sat = value; }
    public int p_fri
    get { return fri; }
    set { fri = value; }
    public int p_thu
    get { return thu; }
    set { thu = value; }
    public int p_wed
    get { return wed; }
    set { wed = value; }
    public int p_tue
    get { return tue; }
    set { tue = value; }
    public int p_mon
    get { return mon; }
    set { mon = value; }
    public int p_sun
    get { return sun; }
    set { sun = value; }
    public int p_eventType
    get { return EventType; }
    set { EventType = value; }
    public string p_Description
    get { return description; }
    set { description = value; }
    public int p_EvnetId
    get { return EventId; }
    set { EventId = value; }
    public string p_eventName
    get { return eventName; }
    set { eventName = value; }
    public int p_PublicView
    get { return public_view; }
    set { public_view = value; }
    public string p_priority
    get { return priority; }
    set { priority = value; }
    public int p_activityType
    get { return EventType; }
    set { EventType = value; }
    public int p_sendNotification
    get { return sendNotification; }
    set { sendNotification = value; }
    public string p_location
    get { return location; }
    set { location = value; }
    public int p_eventstatus
    get { return eventstatus; }
    set { eventstatus = value; }
    public DataTable GETALL_BY_DATE()
    Int64 return_Status;
    String strstatus = "";//To receive the exception msg receive from brick
    OracleCommand objcmd = new OracleCommand(); //Holder object
    DataTable dt = new DataTable();
    OracleParameter[] orapm = new OracleParameter[3];//parameter objects Note: Length should be No. of sp parameters
    OracleCommand[] arcmr = new OracleCommand[1];
    oracle_brick.baked_brick brc = new oracle_brick.baked_brick(BussLayer.PublicSetting.conString);
    String cmdtype = "sp";
    String Cmdstring = "CRM_RECURRINGEVENTS_TAPI.GETALL_BY_DATE";
    orapm[0] = new OracleParameter();
    orapm[0].OracleDbType = OracleDbType.Date;
    orapm[0].Direction = ParameterDirection.Input;
    orapm[0].ParameterName = "P_DATE";
    orapm[0].Value =Convert.ToDateTime(p_Date).ToString("dd-MM-yyyy");
    orapm[1] = new OracleParameter();
    orapm[1].OracleDbType = OracleDbType.NVarchar2;
    orapm[1].Direction = ParameterDirection.Input;
    orapm[1].ParameterName = "EVENT_FREQUENCY";
    orapm[1].Value = p_EVENT_FREQUENCY;
    orapm[2] = new OracleParameter();
    orapm[2].OracleDbType = OracleDbType.RefCursor;
    orapm[2].Direction = ParameterDirection.Output;
    orapm[2].ParameterName = "CRM_EVENTS_RECORDS";
    return_Status = brc.CreateCommand(ref cmdtype, ref Cmdstring, ref objcmd, ref strstatus, ref orapm);
    return_Status = brc.GetDataTable(ref objcmd, ref dt, ref strstatus);
    return dt;
    ************C#.NET code End****************

    Those are the main tables used:
    SQL> descr ident
    Name Null? Type
    CRSW_ID NOT NULL VARCHAR2(256)
    COMPONENT_KEY NUMBER(10)
    JURIS_ID NOT NULL NUMBER(4)
    DOC_TYPE_ID NUMBER(4)
    WEST_ID VARCHAR2(20)
    LOAD_DATE DATE
    MOD_DATE DATE
    STATUS NOT NULL CHAR(1)
    EFFECTIVE_DATE VARCHAR2(10)
    LONG_TITLE VARCHAR2(2000)
    SHORT_TITLE VARCHAR2(2000)
    LANGUAGE CHAR(1)
    TYPE_OF_DOC VARCHAR2(20)
    FLAG_COLOUR CHAR(1)
    ACTION_TYPE CHAR(1)
    FLAG_OVERRIDE_IND CHAR(1)
    OWNER NOT NULL CHAR(1)
    FLAGPROP_IND NOT NULL CHAR(1)
    METADATA_ACTION_TYPE NOT NULL CHAR(1)
    METADATA_STATUS NOT NULL CHAR(1)
    NOVUS_GUID NOT NULL CHAR(33)
    SQL> descr abr_archive
    Name Null? Type
    CRSW_ID NOT NULL VARCHAR2(256)
    XML_DOC SYS.XMLTYPE
    LOAD_DATE NOT NULL DATE
    MOD_DATE NOT NULL DATE
    SQL> descr abridgment
    Name Null? Type
    CRSW_ID NOT NULL VARCHAR2(256)
    DGN_LOCATOR VARCHAR2(30)
    KEYCLASS VARCHAR2(40)
    SUBJ_CODE VARCHAR2(3)
    MOD_DATE DATE
    ABRCLASS_IND NOT NULL CHAR(1)
    SQL> descr rpt_main
    Name Null? Type
    RPT_ID NOT NULL NUMBER
    RPT_GROUP_ID NOT NULL NUMBER
    RPT_CODE NOT NULL VARCHAR2(10)
    RPT_NAME NOT NULL VARCHAR2(100)
    SRCH_CRITERIA VARCHAR2(4000)
    EML_TARGET VARCHAR2(2000)
    EML_SUBJ VARCHAR2(150)
    SUBSCR_NO VARCHAR2(20)
    SUBSCR_PREFIX VARCHAR2(10)
    START_DATE NOT NULL DATE
    SCHED_DAYS NUMBER
    WEED_DATE DATE
    ISSUE_NO NUMBER
    STATUS NOT NULL CHAR(1)
    ABORT_THRESHOLD NUMBER
    SCHED_DATE DATE
    EML_ATTACHMENT_NAME VARCHAR2(200)
    SQL> descr relation
    Name Null? Type
    CITING_DOC NOT NULL VARCHAR2(256)
    CITED_DOC NOT NULL VARCHAR2(256)
    DISPLAY_TEXT VARCHAR2(256)
    HISTORY_CODE NOT NULL NUMBER(4)
    SORT_ID NOT NULL NUMBER(10)
    MOD_DATE NOT NULL DATE
    EXPIRED_IND NOT NULL CHAR(1)
    Thanks,

  • ORA-01843: not a valid month error is coming

    Hi,
    whats wrong with the query
    SELECT to_timestamp((to_char(tO_date('09/29/2006', 'mm/dd/yyyy'))||':'||TO_CHAR(systimestamp,'hh24:mi:ss:ff6')), 'mm/dd/yyyy:hh24:mi:ss:ff6')
    FROM DUAL;

    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

  • [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

  • 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.

  • Not a Valid Month Issue

    Hi,
    When i execute an insert statement i get ORA-01843 not a valid month error.
    below is the SQL i try to execute in SQLPlus;
    Insert into IKD$TA_L_FACHL_SCHRITT (FACHL_SCHRITT_ID, FACHL_SCHRITT_TEXT, VALID_FROM, VALID_TO) values (1,'LOAD_STG_TMD_ZUSATZDATEN' ,'19.08.2008','31.12.9999');
    However if i execute the same in Oracle SQL developer it is working fine. Can someone please suggest what could be the reason for error in SQL PLUS ?
    I suspect this to be the NLS_DATE_FORMAT setting issue, please correct if im wrong.
    Thanks

    Hi,
    Never use a VARCHAR2 where a DATE is needed.
    Use TO_DATE (with 2 arguments) to convert a VARCHAR2 to a DATE when necessary.
    For example:
    Insert into IKD$TA_L_FACHL_SCHRITT
           ( FACHL_SCHRITT_ID, FACHL_SCHRITT_TEXT,             VALID_FROM,              VALID_TO)
    values ( 1,             'LOAD_STG_TMD_ZUSATZDATEN' , TO_DATE ( '19.08.2008'
                                                             , 'DD.MM.YYYY'), TO_DATE ( '31.12.9999'
                                                               , 'DD.MM.YYYY)
           );The problem with implicit conversions is that they don't necessarily use the format you want them to.
    Always use an explicit conversion function, and specify the format.

  • 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.

  • 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?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • How many audio CD's can I burn?

    So, I took the plunge yesterday and bought my first music store tracks. Now have a few questions (I suppose logically I should have looked for the answers first but I just wanted to try it anyway Most of all I'd like to know, is there a restriction o

  • No Video With Google Talk on Droid 3

    Just got my wife the new Droid 3 that's running Android 2.3.4. This is the version of Android that is supposed to support video with Google Talk. Tried starting Talk and only thing I can do is messaging with Talk. No video option like on my Thrive ta

  • HT3209 I downloaded a movie off my iPad how do I get it to play

    Help!!!!!  I downloaded a movie off my iPad but I can't get it to play. It shows downloaded but when I go to downloads it shows nothing. Can I not download and watch directly off of the iPad.

  • Error message iTunes64 Setup.exe is not a valid Win32 application.

    I've tried a few times to update my laptop with latest version of iTunes, even have uninstalled older version, and I just keep getting this message.  What am I doing wrong?  How do I fix it?  I have Windows 7, 64-bit system.  I wouldn't have even tri

  • Using Flash Builder 4.5 to develop for Air for TV?

    How can I target Adobe Air 2.5 when using Flash Builder 4.5 so I develop for Adobe Air for TV? When I change the app.xml file to point to 2.5, I get the following error: "Namespace 2.5.0 in the application descriptor file should be equal or higher th