oracle中的日期格式 [英] Date format in oracle
问题描述
当从asp.net到oracle调用插入查询时,我有一个日期格式错误(ORA-01843:无效的月份).有人可以帮助我确定要转换的正确格式,然后将其插入oracle 10g(TOAD).
注意:我输入的日期格式为1999年11月22日格式.
提前谢谢.
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.
推荐答案
之所以会发生这种情况,是因为您尝试在orcale数据库中插入的日期格式与Oracle日期格式不同(即NLS_Date_Format
).
您可以使用以下查询找到Oracle日期格式:
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 :
SELECT * from NLS_INSTANCE_PARAMETERS;
您可以使用:
将Oracle日期格式设置为任何模式.
You can set the Oracle date format to any any pattern using :
Alter Session set NLS_Date_Format='MM/DD/YYYY'
在Oracle中设置NLS_Date_Format
后,在oracle中插入数据时在vb中使用此格式.
希望这会有所帮助.
最好.
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.
您应该使用适当的格式模型,可以使用格式模型修饰符进行控制.
请参阅:
^ ],
http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm#g195443 [ ^ ].
—SA
You should use appropriate format model which you can control using format model modifiers.
Please see:
http://www.google.com/url?sa=t&rct=j&q=oracle+datetime+format&source=web&cd=1&ved=0CCoQFjAA&url=http%3A%2F%2Fdocs.oracle.com%2Fcd%2FB19306_01%2Fserver.102%2Fb14200%2Fsql_elements004.htm&ei=yzIBT97ZJcP10gGxl7m3Ag&usg=AFQjCNHcIiRFE1SAQjVBJqdnsXGlScfh2A[^],
http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm#g195443[^].
—SA
这篇关于oracle中的日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!