二则 ORA-01722: invalid number错误的处理,substr to_char之间的区别。连接符号错误 + ||
Select to_char(loginDate,'yyyy') as sYear, Count(1) as iCount From l_log where operation='登录'
and InitFlag=1 Group By to_char(loginDate,'yyyy')
> ORA-01722: invalid number
sql语句改为:
Select substr(loginDate,1,4) as sYear, Count(1) as iCount From l_log where operation='登录'
and InitFlag=1 Group By substr(loginDate,1,4)
问题解决
还有一种是字符连接符号错误导致,oracle连接字符要用“||”不能用“+”
and ('','' + ListUser + '','' like %s and iStat <> -1)
改为
and ('','' || ListUser || '','' like %s and iStat <> -1)
问题解决
本文来自博客园,作者:IT情深,转载请注明原文链接:https://www.cnblogs.com/wh445306/p/16751907.html