Search code examples
oracle-databaseplsqlcursor

How to check value return from one query exist on a cursor in pl sql


i have a cursor like this

cursor samp_emp is 
select distinct name
from employee;

i want to check if

'john'

exist on a cursor .is there are any inbuild function exist to check if value exist on the cursor?


Solution

  • without loop through cursor is there anyway of checking if the value exist on the cursor?

    No, if you want to check if a value exists in a cursor then you will need to open the cursor and loop through all the values until either it is found or you have processed all the rows.

    is there are any inbuilt function to check if value exist on a cursor that loop through cursor and check?

    No