Oracle where exists clause not working on SQL Plus

ⅰ亾dé卋堺 提交于 2019-12-13 04:22:33

问题


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


回答1:


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.

The difference may be:

  • database connected
  • connected user
  • current schema
  • NLS settings
  • FGAC policy
  • and so on...

As Juan mentioned, uncommitted data may affect this too.

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.



来源:https://stackoverflow.com/questions/47289059/oracle-where-exists-clause-not-working-on-sql-plus

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!