Skip to content

ORA-00922: 选项缺失或无效 #432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ifooling opened this issue Aug 8, 2022 · 3 comments · Fixed by #434
Closed

ORA-00922: 选项缺失或无效 #432

ifooling opened this issue Aug 8, 2022 · 3 comments · Fixed by #434

Comments

@ifooling
Copy link
Contributor

ifooling commented Aug 8, 2022

环境信息

  • 系统: Windows 11
  • JDK: 1.8.0_17
  • 数据库: Oracle 12C
  • APIJSON: 5.1.0

问题描述

查询时使用性能分析关键字 @explain 报错

查询参数

{
  "Access": {
    "id": 1
  },
  "@explain": true
}

错误信息

"ORA-00922: 选项缺失或无效"

生成的 SQL 如下:

SET STATISTICS PROFILE ON  SELECT * FROM (SELECT "Access".*, ROWNUM RN FROM (SELECT * FROM "CRUD_ACCESS" WHERE  (  ("id" = 1)  ) ) "Access"  WHERE ROWNUM <= 1) WHERE RN > 0

如上sql在oracle中手动执行也报 <选项缺失或无效> 错误,怀疑 oracle 不支持 SET STATISTICS PROFILE ON 参数

是不是我oracle哪里没设置对或者其他问题?

@TommyLemon
Copy link
Collaborator

TommyLemon commented Aug 8, 2022

ifooling added a commit to ifooling/APIJSON that referenced this issue Aug 9, 2022
解决数据源为Oracle时,使用性能分析关键字 @Explain,查询报 "ORA-00922: 选项缺失或无效"问题

issue Tencent#432
closes Tencent#432
@ifooling
Copy link
Contributor Author

@TommyLemon 我改了两个bug 一个@Explain 一个oracle 使用自增主键报错问题

@TommyLemon
Copy link
Collaborator

TommyLemon commented Aug 12, 2022

@TommyLemon 我改了两个bug 一个@Explain 一个oracle 使用自增主键报错问题

感谢贡献,已合并~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants