Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an date format error(ORA-01843: not a valid month) when an insert query is called from asp.net to oracle. Could someone please help me out the correct format to be converted and insert into oracle 10g(TOAD).
NOTE:My date format that is entered is in the format 11/22/1999.
Thanks in advance.
Posted

It happens so because date format you are trying to insert in orcale database is not same as the Oracle date format (i.e. NLS_Date_Format).

You can find the Oracle date format using this query :
SQL
SELECT * from NLS_INSTANCE_PARAMETERS;


You can set the Oracle date format to any any pattern using :
SQL
Alter Session set NLS_Date_Format='MM/DD/YYYY'


Once you set the NLS_Date_Format in Oracle, use this format in vb when inserting data in oracle.

Hope this helps.
All the best.
 
Share this answer
 
Comments
skkworld 1-Jan-12 23:54pm    
I'm not using vb. I'm using c# asp.net. Could u plz tell me in C# asp.net bcoz i'm new to this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900