select t.*, (select a.ANNEXNAME from base_annex a where a.id = t.closeFile) closeFileName, (select a.ANNEXNAME from base_annex a where a.id = t.auditFile) auditFileName, (select u.userText from sy_user u where u.userCode = t.creator) applierText from tablename t WHERE dataFlag = 1 and t.problemId = '25076' and rownum = 1
执行上面的查询报 java.sql.SQLException: ORA-01722: 无效数字,因为子查询有根据id判断的条件
where a.id = t.auditFile
子查询里有个数字型字符串插入错了,auditFile应该是个数字字符串,但是插入错了,插入了字符串4679!''到数据库,!''是freemarker判断非空的,前台模板就写错了。
最后把模板里面改了下,后台数据库想要继续用这条数据,于是想修改这条数据,
修改的时候,弹窗报提示these query result are not updateable,include the ROWID to get updateable
根据提示查询加rowid,如下:
select t.*,t.rowid from tablename t WHERE dataFlag = 1 and t.problemId = '25076' and rownum = 1