[go: up one dir, main page]

Skip to content
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

oracle数据库使用查询功能查询序列报错 #2826

Open
saygoodbay opened this issue Sep 29, 2024 · 0 comments
Open

oracle数据库使用查询功能查询序列报错 #2826

saygoodbay opened this issue Sep 29, 2024 · 0 comments

Comments

@saygoodbay
Copy link

重现步骤

在sql查询在线查询功能中查询oracle序列值报错ORA-02287: sequence number not allowed here
经排查是因为在线查询功能强制使用分页导致,Oracle 不允许在子查询或复杂查询(如分页查询、WHERE 子句或 GROUP BY)中使用 CURRVAL 和 NEXTVAL。这些伪列只能用于简单的 SELECT 语句中,不能与分页、排序或其他复杂的 SQL 操作一起使用。

预期外的结果

企业微信截图_17276016302226
企业微信截图_17276016613148

日志文本

2024-09-29 17:20:23,053 - default - WARNING - Oracle 语句执行报错,语句:select sql_audit.* from (SELECT lc_seq.CURRVAL FROM dual) sql_audit where rownum <= 1000,错误信息Traceback (most recent call last):
  File "/opt/archery/sql/engines/oracle.py", line 678, in query
    cursor.execute(sql, parameters or [])
cx_Oracle.DatabaseError: ORA-02287: sequence number not allowed here

版本

v1.11.2

部署方式

Docker

是否还有其他可以辅助定位问题的信息?比如数据库版本等

oracle版本11.0.2

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

No branches or pull requests

1 participant