问题
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