关于ORA-01861: literal does not match format string
来源:互联网 发布:oracle11g linux自启动 编辑:程序博客网 时间:2024/05/01 02:27
原文:http://q.cnblogs.com/q/14179/
.Net执行SQL时报的错误,我的查询SQL时间条件是:"时间 >= '2010-5-1' and 时间 <= sysdate",环境变量NLS_DATE_FORMAT都配好了,变量值为YYYY-MM-DD HH24:MI:SS。本机调试执行没问题,Toad和PL/SQL执行也都没问题,但是部署到IIS上执行就报错:ORA-01861: literal does not match format string,条件改成"时间 >= to_date('2010-5-1','YYYY-MM-DD') "就没事。为什么本机调试没问题,部署到IIS就会报错(部署也在我本机)?
顺便问下"时间 >= to_date('2010-5-1','YYYY-MM-DD')"这样查破坏了时间索引吗,不是只要左边查询字段(时间)不加函数处理就不会影响索引吗?那为什么速度差别这么大?不加to_date()查询只要2,3秒,但是加上后就70,80秒的样子
1). ORA-01861: 文字与格式字符串不匹配
2). 必须指定日期格式
to_date('2010-05-11 14:20:24' , 'yyyy-mm-dd hh24:mi:ss')
3). 比较时间也可以将数据的时间字段to_char('时间','yyyy-mm-dd hh24:mi:ss').变成字符串,再去按字符串比较.
当然你的字符串'2010-5-1'也要to_char(to_date('2010-5-1','yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss').
- 关于ORA-01861: literal does not match format string
- ORA-01861: literal does not match FORMat string 错误原因
- Oracle异常ORA-01861: literal does not match format string。
- ORA-01861: literal does not match format string 错误!
- ORA-01861: literal does not match format string
- Oracle 异常 ORA-01861: literal does not match format string
- 关于时间比较,ORA-01861: literal does not match format string
- Oracle 异常 ORA-01861: literal does not match format string(字符串格式不匹配)
- Oracle 异常 ORA-01861: literal does not match format string(字符串格式不匹配)
- oracle学习笔记【 ORA-01861: literal does not match format string(字符串格式不匹配)】
- 解决:Oracle 异常 ORA-01861: literal does not match format string(字符串格式不匹配)
- 解决Oracle异常ORA-01861:literal does not match format string(字符串格式不匹配)
- Oracle异常ORA-01861:literal does not match format string(字符串格式不匹配)
- literal does not match format string 解决办法
- literal does not match format string
- Oracle 异常 ORA-01861: literal does not match form
- format not a string literal and no format arguments
- format not a string literal and no format arguments
- 使用Size Classes 的注意事项
- java获取指定文件夹下的所有文件名
- 算术表达式的转换
- Scala学习笔记8 - 集合
- HDU 1301 / POJ 1251 Jungle Roads(最小生成树)
- 关于ORA-01861: literal does not match format string
- 还是畅通工程
- H5:<meta> 标签详解
- 关于mysql中触发器old和new如何更好的区别我有话要说?
- 纪念七夕情人节的完美婚姻算法
- python abs()函数
- 程序发布服务器步骤
- 树的子结构
- Hadoop WritableComparator RawComparator