title: Stored procedure with recursive call using mysql
body: <p><a href="https://i.stack.imgur.com/xgOgu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xgOgu.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/h5aNM.png" rel="noreferrer">enter image description here</a><a href="https://i.stack.imgur.com/sJvWh.png" rel="noreferrer">get legside from binary</a></p>
  
  <p>I have tried using stored procedure with recursive call. i need to display relevant name based on emp_name based on leg1</p>
  
  <p>but it showing error like #1414 - OUT or INOUT argument 2 for routine sample.getVolume is not a variable or NEW pseudo-variable in BEFORE trigger </p>
  
  <p>Here is my code,</p>
  
  <pre><code>DELIMITER $$
  CREATE PROCEDURE getVolume( IN param_name VARCHAR(255), OUT result VARCHAR(255 ))
  BEGIN 
  SELECT val INTO result FROM employee WHERE emp_name = param_name ;
  IF result IS NULL THEN
  select result;
  ELSE     
  CALL getVolume(result, '');
  END IF;
  END $$
  DELIMITER ;
  
  
  
  SET @@GLOBAL.max_sp_recursion_depth = 255;
  SET @@session.max_sp_recursion_depth = 255; 
  call getVolume('new', @result);
  select @result;
  </code></pre>