MySQL Forums
Forum List  »  Newbie

Re: Argument passing - column values.
Posted by: Rick James
Date: August 24, 2014 01:54PM

set @best_query = concat("select Hospital_Name into ", p_name,
-->
set @best_query = concat("select Hospital_Name into p_name ",
-->
set @best_query = concat("select Hospital_Name into @local_name ",

It seems like the entire SP could be just this (no PREPARE, no @, etc)
SELECT  IFNULL( 
              ( SELECT  Hospital_Name
                    from  hospital_outcomes
                    where  p_illness > 0
                      and  State = p_state
                    order by  p_illness Hospital_Name
                    Limit  1 ), 'NA'
              );
which would not even need a SP.

Options: ReplyQuote


Subject
Written By
Posted
Re: Argument passing - column values.
August 24, 2014 01:54PM


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.