Question

Exists in WHERE condition

  • 21 March 2024
  • 5 replies
  • 71 views

Badge +4

Hi all,

Do you have an idea why Exists() doesn’t work here? It seems to only work in an IF condition.
 

Kind regards,


5 replies

Userlevel 6
Badge +13

@haritha.waidyaratne What is the result produced by the method call?

I suspect it might trigger a "Too Many Rows" exception rather than returning a value of True or False. Please check !

Badge +4

Hi Buddhika,

Sure will check it in detail and get back to you.

Thanks many for the suggestion.

Kind regards,
Haritha

Userlevel 7
Badge +20

Hi @haritha.waidyaratne 

Oracle doesn’t have the support for BOOLEAN in comparison rules. Exists returns a Boolean and therefore you cannot use it in a condition expression.

Check here for more details

https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Data-Type-Comparison-Rules.html

 

Hope it helps.

Damith

Badge +4
Hi,If you explain in detail the query you want to make, I can help you in a different format.
Badge +4

Hi Alpenen,

Thanks for offering to help. I have already accomplished the task. My question was why Exists() doesn’t work as expected.

Kind regards,

Reply