检查Oracle版本,然后运行子问题
我正在尝试根据Oracle中的版本运行子问题。自Oracle发布以来,新版本21C必须以这种方式修改查询。
我想检查版本是否为19c,然后从sys.aud $中获取值,以audsys.aud $ unified。
select version,
CASE
WHEN version <= '19.0.0.0.0' THEN (select * from sys.aud$)
ELSE
(select * from AUDSYS.AUD$UNIFIED)
END version_group
from v$Instance;
我得到了ORA-00913:作为错误的值太多。
I am trying to run the sub-query based on version in Oracle. Since oracle released the new version 21c have to modify the query in that way.
I would like to check if the version is 19c then take the value from sys.aud$ else take the value AUDSYS.AUD$UNIFIED.
select version,
CASE
WHEN version <= '19.0.0.0.0' THEN (select * from sys.aud$)
ELSE
(select * from AUDSYS.AUD$UNIFIED)
END version_group
from v$Instance;
I am getting ORA-00913: too many values as the error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是PL/SQL,则可以使用条件汇编。例如:
If you are using PL/SQL then you can use conditional compilation. For example: