问题描述
我有一个带有"WHERE EXISTS()"子句的查询.当我在SQL Developer上执行它时,它返回行,但是当我在SQL Plus中执行它时,它不返回行.
I have a query with a "WHERE EXISTS()" clause.When I execute it on SQL Developer it returns rows, but when I execute it in SQL Plus it doesn't.
有人知道为什么会这样吗?提前致谢.问候,乔奥
Any one has a clue why this is happening?Thanks in advance.Regards,Joao
推荐答案
如果查询将行返回到一个数据库会话中(例如,由SQL Developer创建),而不返回另一行中的任何行(例如,由SQL创建)另外),这意味着这些会话是不同的.
If the query returns rows into one database session (say, created by SQL Developer) and doesn't return any rows in the other (say, created by SQL Plus) it means these sessions are different.
不同之处可能是:
- 数据库已连接
- 连接的用户
- 当前架构
- NLS设置
- FGAC政策
- 依此类推...
正如Juan所说,未提交的数据也可能会影响到这一点.
As Juan mentioned, uncommitted data may affect this too.
如果您查看SQL Developer中的某些行,我会说检查是否可以将这些行访问到SQL Plus(使用类似select * from table where id = <id visible in SQL Developer>
的功能).如果此操作返回一些行,请参见为什么在SQL Plus中由查询过滤了它.如果此操作不返回行,则请查看您是要连接到其他数据源还是无法访问数据.
If you look at some rows in SQL Developer, I'd say check if you can access these rows into SQL Plus (use something like select * from table where id = <id visible in SQL Developer>
). If this returns some rows - see why it's filtered by your query in SQL Plus. If this doesn't return rows either see if you are connecting to a different data source or have no access to the data.
这篇关于Oracle where exist子句不适用于SQL Plus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!