ora -00904
时间: 2023-07-29 18:13:20 浏览: 252
ORA-00904是Oracle数据库的错误代码,表示无效的标识符。这个错误通常发生在SQL查询中,当引用了一个不存在的列名或表名时会触发该错误。
引用\[1\]中的示例查询中,使用了一个不存在的列名"st_id",导致了ORA-00904错误。正确的列名应该是"student_id"。因此,需要修改查询为:SELECT student_id AS stid, first_name, last_name FROM student WHERE student_id = 10; \[1\]
引用\[2\]中的示例代码中,使用了一个不存在的列名"PWD",导致了ORA-00904错误。正确的列名应该是"pwd"。因此,需要修改查询为:User user = userDao.findByPwd("ccat"); \[2\]
引用\[3\]中提到,如果在创建表时使用了双引号将表名或字段名括起来,那么在查询时也需要使用双引号来引用这些标识符。否则,Oracle数据库会将它们视为不区分大小写的标识符。因此,在查询时需要使用双引号来引用表名和字段名,以避免ORA-00904错误的发生。例如:SELECT "ID" from "tablename"; \[3\]
综上所述,ORA-00904错误通常是由于引用了不存在的列名或表名导致的。需要仔细检查查询语句中的标识符是否正确,并根据需要使用双引号来引用标识符。
#### 引用[.reference_title]
- *1* [ORA-00904: 标识符无效解决方案(oracle 00904)](https://blog.csdn.net/weixin_42386551/article/details/106926862)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [ORA-00904:标识符无效(太坑了!!)](https://blog.csdn.net/weixin_47356053/article/details/125621613)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [[Error Code: 904, SQL State: 42000] ORA-00904 : 标识符无效](https://blog.csdn.net/hyfstyle/article/details/121121331)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文
相关推荐
















