title: I'm having difficulties calling a stored procedure in another one
body: <p>I want to call a stored procedure in another one but the syntax doesn't seem to be correct.</p>
  
  <p>I've tried to just skip the process and do the select command directly but that doesn't seem to work and besides I'd like to know how to do this.</p>
  
  <pre><code>DELIMITER //
  create procedure Find_Eid(Pid int)
      select EId from Employees inner join Patient on EId = EId_fk where Patient.PId = Pid;
  //
  DELIMITER ;
  call Find_Eid(4);
  drop procedure Fill_Interact;
  DELIMITER //
  create procedure Fill_Interact()
  begin
      declare N1 int;
      declare TOT date;
      declare Rid int;
      declare Pid int;
      declare Eid int;  
      set N1 = (select count(*) from Patient);
      set TOT = curdate();
      set Rid = 1;
      set Pid = 1;
      while N1 &gt; 0 do
          set Eid = (call Find_Eid(Pid));
          insert into Interact
          (Time_Of_Treatment, RId_fk, PId_fk, EId_fk)
          values
          (TOT,Rid,Pid, Eid);
          if Rid = (select count(*) from Room limit 1) then
                  set Rid = 1;
                  set TOT = TOT + 1;
          else
                  set Rid = Rid + 1;
          end if;
          set N1 = N1 - 1;
          set Pid = Pid + 1;
      end while;
  end;
  //
  DELIMITER ;
  call Fill_Interact();
  
  select * from Interact;
  </code></pre>