java.sql.SQLException: ORA-00911: 无效字符
IBATIS报无效的字符错误<insert id="initinsert" parameterClass="java.util.HashMap">
INSERT INTO t_servic_psrevalgrade_detail
(servic_psrevaluategradeid_deta,
servic_psrevaluategradeid,
level_id,
sys_res_code,
equipmentclassifyvalue,
auditingequipmentclassifyvalue,
roublereason,
isfault,
equiptroubleid)
SELECT sys_guid() servic_psrevaluategradeid,
#SERVIC_PSREVALUATEGRADEID# servic_psrevaluategradeid,
ss.level_id,
ss.sys_res_code sys_res_code,
decode(equiptroublegradecode, '一般(三类)', 2, '紧急(二类)', 3, '重大(一类)', 3, 1) equipmentclassifyvalue,
decode(equiptroublegradecode, '一般(三类)', 2, '紧急(二类)', 3, '重大(一类)', 3, 1) auditingequipmentclassifyvalue,
equiptroublecausedetail roublereason,
decode(q.equiptroubleid, NULL, '0', '1') isfault,
q.equiptroubleid equiptroubleid
FROM t_system_source ss,
(SELECT *
FROM t_sbqxtz qq
WHERE qq.equiptroubleid IN
(SELECT MAX(qqq.equiptroubleid)
FROM t_sbqxtz qqq
WHERE (qqq.sys_res_code,
decode(equiptroublegradecode, '一般(三类)', 1, '紧急(二类)', 2, '重大(一类)', 3, 4)) IN
(SELECT sys_res_code,
MAX(decode(qq.equiptroublegradecode, '一般(三类)', 1, '紧急(二类)', 2, '重大(一类)', 3, 4)) grade
FROM t_sbqxtz qq
WHERE qq.state != '5'
GROUP BY qq.sys_res_code)
AND qq.state != '5'
GROUP BY sys_res_code)) q
WHERE ss.sys_res_code = q.sys_res_code(+)
AND (ss.sys_res_code LIKE #SYS_RES_CODE#||'%' OR
ss.sys_res_code LIKE #SYS_RES_CODE#||'%' OR
ss.sys_res_code LIKE #SYS_RES_CODE#||'%')
ORDER BY ss.sys_res_code
</insert>
Caused by: com.toft.core3.jdbc.BadSqlGrammarException: Bad SQL grammar [equipclassify.initsh]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/gdisoft/soms/biz/equipclassify/dao/equipclassify.xml.
--- The error occurred while applying a parameter map.
--- Check the equipclassify.initsh-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: ORA-00911: 无效字符
at com.toft.core3.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(Unknown Source)
at com.toft.core3.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(Unknown Source)
at com.toft.core3.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(Unknown Source)
at com.toft.core3.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(Unknown Source)
at com.toft.core3.ibatis.support.AbstractIBatisDao.execute(Unknown Source)
at com.toft.core3.ibatis.support.AbstractIBatisDao.execute(Unknown Source)
at com.gdisoft.soms.biz.equipclassify.dao.EquipclassifyDao.initsh(EquipclassifyDao.java:103)
at com.gdisoft.soms.biz.equipclassify.service.EquipclassifyService.saveAssignNode(EquipclassifyService.java:79)
at com.gdisoft.soms.biz.equipclassify.action.EquipclassifyAction.saveAssignNode(EquipclassifyAction.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
... 32 more --------------------编程问答-------------------- 我是小白么?你的insert语句怎么和我接触的差距怎么那么大呢? --------------------编程问答-------------------- 某个字段写错了?核对看看 --------------------编程问答-------------------- 没有预处理写sql吗,或者构建一个对象,这个多难找啊,看了楼下是毅力帝吗 --------------------编程问答-------------------- equipclassify.initsh
.点在数据库有特殊意思,换个名字吧 --------------------编程问答-------------------- 很显然,sql文是mysql的吗
放到可视化sql工具里面运行一下,一般字段名写错
排查起来不难吧
很难么?
不难么?
不难啊!
不难?
真的不难!
真的不难?
真的不难!
真的?
真的!
好吧。。。。 --------------------编程问答-------------------- 看到这个sql,让我想到一句话:所有的业务逻辑都用sql写出来 --------------------编程问答--------------------
这是一种选择,但是我认为很多商务逻辑不应该让DB承担的,DB只需要维护数据及完整性就好。
商务逻辑还是交给业务层去解决吧。这样也有利于负荷分散啊。
补充:Java , Java EE