title: Selecting Stored Procedure Value in Query in MySQL
body: <p>I found numerous threads close to this but non answer my question exactly so here goes.</p>
  
  <p>I am writing a report that needs to use a variable I declared as one of the SELECT fields.</p>
  
  <p>Here is the store procedure code:
      DROP PROCEDURE IF EXISTS sp_Test</p>
  
  <pre><code>CREATE PROCEDURE `sp_Test`(facilityId INT, startDate DATE, endDate DATE)
  BEGIN
  
  DECLARE facilityName VARCHAR(256);
  
  SELECT facility_name INTO facilityName FROM `reporting`.`facilities` WHERE `reporting`.`facilities`.facility_id = facilityId;
  
  SELECT `reporting`.`error_stratification`.description AS Stratification, facilityName
  ...Rest of query that is not important
  
  END
  </code></pre>
  
  <p>The only problem is that it puts the string "facilityName" in my query results not the value of it.</p>
  
  <p>Is there a way to force it to output the value there?</p>