oracle error..ORA-01858

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sushil4487
    New Member
    • Jun 2007
    • 1

    oracle error..ORA-01858

    I am getting this error while writing this query.
    I am using the same query in other server but i am not getting any error message
    Do I need to reset the date format in Server.

    Date is saved in table as varchar.. I want to convert it into date format

    SQL> desc mis_branch_mast er
    Name Null? Type
    ------------------------------- -------- ----
    PARAMETER NOT NULL VARCHAR2(15)
    PARAM_VAL VARCHAR2(25)

    SQL> select * from mis_branch_mast er;

    PARAMETER PARAM_VAL
    --------------- -------------------------
    Br_Name MODEL Branch
    RO_Name Mahalaxmi Layout
    CO_Name Bangalore
    DP_Code 1091
    BSCA_Code 9999
    DB_Ver 2.09
    AP_Ver 2.00
    Bal_Date 30-JUN-2007

    8 rows selected.

    SQL> select to_date(param_v al,'dd/mm/rrrr') from mis_branch_mast er
    2 where parameter = 'Bal_Date';
    ERROR:
    ORA-01858: a non-numeric character was found where a numeric was expected



    no rows selected
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by sushil4487
    I am getting this error while writing this query.
    I am using the same query in other server but i am not getting any error message
    Do I need to reset the date format in Server.

    Date is saved in table as varchar.. I want to convert it into date format

    SQL> desc mis_branch_mast er
    Name Null? Type
    ------------------------------- -------- ----
    PARAMETER NOT NULL VARCHAR2(15)
    PARAM_VAL VARCHAR2(25)

    SQL> select * from mis_branch_mast er;

    PARAMETER PARAM_VAL
    --------------- -------------------------
    Br_Name MODEL Branch
    RO_Name Mahalaxmi Layout
    CO_Name Bangalore
    DP_Code 1091
    BSCA_Code 9999
    DB_Ver 2.09
    AP_Ver 2.00
    Bal_Date 30-JUN-2007

    8 rows selected.

    SQL> select to_date(param_v al,'dd/mm/rrrr') from mis_branch_mast er
    2 where parameter = 'Bal_Date';
    ERROR:
    ORA-01858: a non-numeric character was found where a numeric was expected



    no rows selected
    If the Bal_Date is the one stored in the DB as a varchar then isn't it the one that you want to do to_date on first? .

    Comment

    • Saii
      Recognized Expert New Member
      • Apr 2007
      • 145

      #3
      try using to_char on param_val before the to_date conversion.

      Comment

      Working...