cancel
Showing results for 
Search instead for 
Did you mean: 

date format error in JDBC receiver

Former Member
0 Kudos

Hi All,

I am doing a scenario File to JDBC. It works fine with string datatypes...

However when i try inserting date fields it gives me error:

<b>java.sql.SQLException: ORA-01861: literal does not match format string</b>

I am getting date in format : ddMMyyyy.

I thought it is error due to wrong date format so i used TransformDate function and converted to dd/MM/yyyy and now i am getting error:

<b>java.sql.SQLException: ORA-01843: not a valid month</b>

Can anybody tell me why is this error coming? How can i find out exact date format required to database?

thanks,

Atul

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

for Oracle ,you need to use TO_DATE() function,you can also handle this in a simple UDF

/people/alessandro.berta/blog/2005/10/04/datetime-datatypes-and-oracle-database

Thanx

Aamir

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Atul,

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

<b>ORA-01861 literal does not match format string:</b>

Cause: Literals in the input must be the same length as literals in the format

string (with the exception of leading white space). If the "FX" modifier has been

toggled on, the literal must match exactly, with no extra white space.

Action: Correct the format string to match the literal.

<b>ORA-01843 not a valid month:</b>

Cause: A date specified an invalid month. Valid months are:

January-December, for format code MONTH, and Jan-Dec, for format code

MON.

Action: Enter a valid month value in the correct format.

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.

*Pls :Reward points if helpful*

Regards,

Jyoti

VijayKonam
Active Contributor
0 Kudos

Did you try MM/dd/yyyy format??

VJ