Cursor with if then statements in oracle stored procedure
903048Dec 1 2011 — edited Dec 1 2011Please help I have a situation where I need to have if then statements inside the cursor I am a newbie to Oracle and not sure how to do this
the following sample code throws errors
cursor c_students is
if v_Active = '1' then
select student from users where username in ('abc' );
else if v_Active = '0' and student_status = '1' then
select student from users where username in ('def');
else if v_Active = '0' and student_status = '2' then
select student from users where username in ('def','abc');
end if;