简体   繁体   中英

Oracle where exists clause not working on 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM