使用Mybatis时报错Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

时间:2023-03-09 22:48:34
使用Mybatis时报错Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

首先保证sql语句在oracle中的编写是正确的,然后在配置文件中插入时就报这样的错误。有可能是因为sql语句后面多了“;”分号,在标签中写分号是错的。如果我写成了

insert into employees(employee_id,last_name,email,gender)
values(employees_seq.nextval,'xiao','xiao@163.com','');

将其改成下面这样就可以了

insert into employees(employee_id,last_name,email,gender)
values(employees_seq.nextval,'xiao','xiao@163.com','')