Also see following error messages:

OCI-01861: literal does not match format string

 ORA-01861: Literal does not match format string

    You tried to convert a literal using a format string, but the length of the format mask didn't match the length of the literal.

    eg:



    SELECT to_date('20061025','fxyyyy/mm/dd')
    FROM dual

    SELECT to_date('20061025','fxyyyy/mm/dd')
    *
    ERROR at line 1:
    ORA-01861: literal does not match format string


    It can happen sometimes that you are expecting this error, but you still get a correct date.

    eg.:


    SELECT to_date('20061025','yyyy/mm/dd')
    FROM dual
    SQL> /

    TO_DATE('
    ---------
    25-OCT-06

    Succeeds, but following results in an error, because there are no 13 months

    SELECT to_date('20061325','yyyy/mm/dd')
    FROM dual
    SQL> /
    SELECT to_date('20061325','yyyy/mm/dd')
    *
    ERROR at line 1:
    ORA-01861: literal does not match format string



    This is standard Oracle behaviour (string to date conversion rules).

    Oracle tries to convert the month part of a literal to a valid month before applying the format mask.



    If you do not want this behaviour, use the FX formatting.


    As a general rule of thumb, when using the to_date, to_timestamp, ... functions make sure the literal size matches the format mask



Adverteren bij Daisycon
Forum Messages
21-FEB-2008 01:53:16ORA-01861: literal does not match format stringM.A.Nagashree Reply
when i try to insert same values in sql it is getting inserted. But, when i insert through front end (ASP.NET), i am gettting "ORA-01861: literal does not match format string " error.
what would be the problem.
please help as soon as possible.
28-MAR-2008 12:53:47ORA-01861: literal does not match format stringSunil Kumar Sharma Reply
select DISTINCT d.VENDOR_NAME,b.INVOICE_ID,a.ATTRIBUTE1,b.INVOICE_AMOUNT,b.INVOICE_NUM,
a.INVOICE_DATE,abs(a.INVOICE_AMOUNT),
f.TAX_NAME,f.SECTION_CODE,f.TAX_RATE,f.TAX_ID,a.ORG_ID,e.TDS_VENDOR_TYPE_LOOKUP_CODE,e.PAN_NO
from
ap_invoices_all a,ap_invoices_all b,JA_IN_TAX_CODES f,ap_invoice_distributions_all c,
po_vendors d,ja_in_vendor_tds_info_hdr e,hr_operating_units g
where
to_number(a.ATTRIBUTE1)=b.INVOICE_ID
and to_number(c.ATTRIBUTE1)=f.TAX_ID
and b.INVOICE_ID=c.INVOICE_ID
and c.INVOICE_ID=to_number(a.ATTRIBUTE1)
and a.VENDOR_ID=d.VENDOR_ID
and b.VENDOR_ID=d.VENDOR_ID
and a.ATTRIBUTE1where to_number ( a.ATTRIBUTE1 ) = b.INVOICE_ID and to_number ( c.ATTRIBUTE1 ) = f.TAX_ID and b.INVOICE_ID = c.INVOICE_ID and c.INVOICE_ID = to_number ( a.ATTRIBUTE1 ) and a.VENDOR_ID = d.VENDOR_ID and b.VENDOR_ID = d.VENDOR_ID and a.ATTRIBUTE1 is not null
--a.ORG_ID=e.ORGANIZATION_ID and
and g.ORGANIZATION_ID =:Name
--and to_char(a.INVOICE_DATE,'DD-MON-RRRR')
and to_date(a.INVOICE_DATE,'DD-MON-RRRR')
between to_date(:From_date ,'DD-MON-RRRR')and to_date(:To_date,'DD-MON-RRRR')
and d.VENDOR_ID=e.VENDOR_ID
and f.Section_code like :SectionCode
and e.TDS_VENDOR_TYPE_LOOKUP_CODE Like :Vendor_Type
and a.SOURCE like 'TDS'
and a.INVOICE_TYPE_LOOKUP_CODE like 'CREDIT'


when m runing in toad i am not getting any kind of error.
but m registering with the oracle then m running it,it is throwing me a error..
please help me out with this problem..
thanks & regards

Sunil
: ->  28-MAR-2008 12:58:46Different Oracle_home? DbMotive Reply
Are toad and the other program using a different Oracle_home?

It is possible that there is a different value for the NLS_DATE_FORMAT set in the different Oracle home's.

What is the format of the :from_date and :to_date you are passing to the procedure?

It can help to set the nls_date_format to the correct setting at connect time:

alter session set nls_date_format='DD-MON-YYYY'
Add your message for ORA-01861
Name:email:
Validation Code:xbzqfwfrcwix0spzd
Enter Code above:
Title:
State your problem: