MySQL Forums
Forum List  »  Newbie

Re: Handle return of empty set from select
Posted by: Peter Brawley
Date: August 22, 2014 09:43AM

BBCode tag delimiters are square brackets [] not angle brackets <>.

Is this what you mean?

create procedure best( IN in_state VARCHAR(255) ) 
  begin    
    set @result='';
    select Hospital_Name into @result
    from hospital_outcomes 
    where Death_Rates_Heart_Attack > 0 and State = in_state
    order by Death_Rates_Heart_Attack, Hospital_Name    
    Limit 1;
    select ifnull(@result,'Empty');
  end;

Options: ReplyQuote


Subject
Written By
Posted
Re: Handle return of empty set from select
August 22, 2014 09:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.