Oracle
查询表名为User的表报ORA-00903:表名无效
问题描述:
- 首先
Oracle
内部已有USER
表
- 使用
SELECT * FROM USER
:提示“表名无效”:
解决方法:
1
SELECT * FROM "USER"
1
SELECT * FROM "数据库名"."USER"
在使用spring boot + mybatis + oracle
时可以如下使用:
1
2
3
public interface UserOracleMapper {
4
5
"SELECT * FROM "USER"") (
6
List<User> findAll();
7
8
"INSERT INTO "USER" (username, age) VALUES (#{username}, #{age})") (
9
void addOne(User user);
10
11
"SELECT * FROM "USER" WHERE id = #{id}") (
12
User findOne(Integer id);
13
14
"UPDATE "USER" SET username = #{username}, age = #{age}") (
15
void updateOne(User user);
16
17
"DELETE FROM "USER" WHERE id = #{id}") (
18
void delOne(Integer id);
19
}