01 ORA系列:ORA-00904 标识符无效 invalid identifier
如果希望对常见的Oracle异常ORA报错解决方案有系统的了解,请看《ORACLE系列异常总结ORA》。
转载请说明出处:https://blog.csdn.net/baidu_37107022/article/details/80874960
1.字段名称与数据库中关键字冲突
修改如下:
2.多层嵌套查询,内层字段别名使用了双引号
错误原因:
内层查出的字段别名使用了,双引号。
当外层要调用里层的字段时,里层字段别名不能使用双引号。
比如将 report.fid as "reportId" 改为 report.fid as reportId 就可以了
正确写法如下:
select temp.reportId,temp.status,temp.detail
from (select report.fid as reportId,
report.ftransactionstatus as status,
report.ftenementdetail as detail
from t_trade_transactionreport report) temp;
3.执行插入时,名称没有建立映射
错误SQL如下
原因:下面的映射字段,没有给别名
正确SQL如下
4.查询条件使用了双引号
正确SQL:双引号改为单引号
SELECT T.FID "id",
T.FKTRANSACTSTEPID "transactStep.id",
T.FSTEPENUM "stepEnum",
T.FSTATUS "status",
T.FACCEPTORENUM "acceptorEnum",
T.FCONTENT "content",
T.FOPINION "opinion",
T.FKAUDITPERSONID "auditPerson.id",
T.FKAUDITORGID "auditOrg.id",
T.FKCREATEBYID "createBy.id",
T.FCREATETIME "createTime",
T.FKCUID "cu.id"
FROM T_TRADE_TRANSFERSMSMODEL T
WHERE T.FSTATUS != 'DELETED'