on 12-13-2007 2:54 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try MM/dd/yyyy format??
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.