GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ORA-00922: 选项缺失或无效 · Issue #432 · APIJSON/APIJSON

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

New issue
Copy link
New issue
Copy link
Closed
#434
Closed
ORA-00922: 选项缺失或无效#432
#434
Copy link
Labels
Bug 漏洞Oraclehelp wanted请求帮助请求帮助

Description

@ifooling
ifooling
opened on Aug 8, 2022
Issue body actions

环境信息

  • 系统: 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哪里没设置对或者其他问题?

Activity

  1. TommyLemon
    added
    Oracle
    on Aug 8, 2022
  2. TommyLemon commented on Aug 8, 2022

    @TommyLemon
    TommyLemon
    on Aug 8, 2022
    Member
    More actions

    @ifooling 感谢反馈。
    看官网文档应该是
    "EXPLAIN PLAN FOR ..."
    https://docs.oracle.com/cd/B10501_01/server.920/a96533/ex_plan.htm
    image

    可以在 AbstractSQLConfig.getSQL 改一行代码来兼容
    https://github.com/Tencent/APIJSON/blob/master/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java#L3982
    image

    可以帮忙改下发个 Pull Request,谢谢。开源要大家一起参与贡献才会更美好~
    image

    https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md#%E4%B8%BA%E4%BB%80%E4%B9%88%E4%B8%80%E5%AE%9A%E8%A6%81%E8%B4%A1%E7%8C%AE%E4%BB%A3%E7%A0%81

    #406

  3. TommyLemon
    added
    Bug 漏洞
    help wanted请求帮助请求帮助
    on Aug 8, 2022
  4. ifooling
    added a commit that references this issue on Aug 9, 2022

    fix:解决数据源为Oracle时,@Explain 报错问题

    f3e7ed1
  5. ifooling commented on Aug 11, 2022

    @ifooling
    ifooling
    on Aug 11, 2022
    ContributorAuthor
    More actions

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

    Reacted by TommyLemon
  6. TommyLemon
    closed this as completedin #434on Aug 12, 2022
  7. TommyLemon commented on Aug 12, 2022

    @TommyLemon
    TommyLemon
    on Aug 12, 2022
    Member
    More actions

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

    感谢贡献,已合并~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 漏洞Oraclehelp wanted请求帮助请求帮助

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.