title: MYSQL if parameter null then set
body: <p>I am new to MYSQL but have a basic understanding of SQL, and i am trying to say that if my parameter has not be set (ie null) then set it as JM.</p>
  
  <p>What/where am i going wrong with the below script?</p>
  
  <p>Thanks in advance</p>
  
  <pre><code>CREATE DEFINER=`james`@`%` PROCEDURE `Project_Status`(IN engineer VARCHAR (5))
  BEGIN
  
  SELECT 
      PP.pid_full,
      PP.description_small,
      PP.project_status,
      PP.est_comp_date as 'Est Comp Date',
      EP.engineer
  FROM 
      project_pid pp
  JOIN
      eng_project_hours EP on PP.pid_full = EP.pid_full
  
  where engineer = ep.engineer;
  
  IF engineer is null then update engineer = jm
  set engineer = ep.engineer;
  end if;
  
  end
  </code></pre>