01 ORA系列:ORA-00904 标识符无效 invalid identifier
如果希望對(duì)常見(jiàn)的Oracle異常ORA報(bào)錯(cuò)解決方案有系統(tǒng)的了解,請(qǐng)看《ORACLE系列異常總結(jié)ORA》。
?
轉(zhuǎn)載請(qǐng)說(shuō)明出處:https://blog.csdn.net/baidu_37107022/article/details/80874960
?
1.字段名稱與數(shù)據(jù)庫(kù)中關(guān)鍵字沖突
修改如下:
?
2.多層嵌套查詢,內(nèi)層字段別名使用了雙引號(hào)
錯(cuò)誤原因:
內(nèi)層查出的字段別名使用了,雙引號(hào)。
?
當(dāng)外層要調(diào)用里層的字段時(shí),里層字段別名不能使用雙引號(hào)。
比如將 report.fid as "reportId" ? 改為 report.fid as reportId 就可以了
?
正確寫(xiě)法如下:
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.執(zhí)行插入時(shí),名稱沒(méi)有建立映射
錯(cuò)誤SQL如下
?
原因:下面的映射字段,沒(méi)有給別名
正確SQL如下
?
4.查詢條件使用了雙引號(hào)
正確SQL:雙引號(hào)改為單引號(hào)
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'
總結(jié)
以上是生活随笔為你收集整理的01 ORA系列:ORA-00904 标识符无效 invalid identifier的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 深入理解和使用Oracle中with a
- 下一篇: 03 ORA系列:ORA-00942 表