Cursor Empty? How do I check?
512308Oct 4 2006 — edited Oct 4 2006hi! i just want to ask what was wrong with my pl/sql code block below? what i wanted is when i search the parts table (w/c is the first statement) and it found that it does not contain any records it will eventually execute the if statement, but somehow i am lost here. pls. help! thank you sooo muuuch!
CREATE OR REPLACE
procedure sp_findAccessories(
p_searchAccessories in varchar2,
p_resultSet out types.cursorType) as
begin
open p_resultSet for
select * from parts
where (partid = p_searchAccessories);
if p_resultSet is null then
open p_resultSet for
select * from parts
where (lower(partname) like '%' || lower(p_searchAccessories) || '%');
end if;
end sp_findAccessories;