Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cursor Empty? How do I check?

512308Oct 4 2006 — edited Oct 4 2006
hi! 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;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 1 2006
Added on Oct 4 2006
15 comments
4,762 views