title: MySQL Stored Procedure return value without a SELECT
body: <p>I have written the following stored procedure:</p>
  
  <pre><code>DELIMITER $$
  CREATE PROCEDURE `getroom`(OUT `free_room` INT)
  BEGIN
  
      SELECT room INTO free_room FROM admins WHERE free = 1 LIMIT 1 FOR UPDATE;
      UPDATE admins SET free = 0 WHERE room = free_room;
  
  END$$
  DELIMITER ;
  </code></pre>
  
  <p>I am trying to query the table for free rooms, lock the row so other users cannot query it at the same time, and set it as not free at the end.</p>
  
  <p>My questions are:</p>
  
  <p>1) How can I call a stored procedure and get the <strong>free_room</strong> value automatically (as if i ran a SELECT statement) without doing an additional SELECT statement?</p>
  
  <p>2) Since I am not passing any arguments (don't have "IN" values), why can't I run <code>CALL getroom()</code> succssfully? I get the following error:</p>
  
  <blockquote>
    <p>Incorrect number of arguments for PROCEDURE getroom; expected 1, got 0</p>
  </blockquote>
  
  <p>Hope my questions are clear enough!</p>