title: Dynamic SQL | PL/SQL
body: <p>I've run into trouble with Dynamic SQL, I want to be able to display the department_id:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE pro_two_tables
      (p_input VARCHAR2) IS
       v_department_id employees.department_id%TYPE;
  
  BEGIN
      EXECUTE IMMEDIATE
         'SELECT department_id
      /* MYSTERY FOR ME */
             FROM ' || p_input || '
                WHERE manager_id = 205';
  DBMS_OUTPUT.PUT_LINE('You selected ID from the table' || ' ' || p_input || ' ' || 'ID   is' ||' ' || v_department_id);
  
  EXCEPTION
     WHEN NO_DATA_FOUND THEN
        DBMS_OUTPUT.PUT_LINE('No data found');
     WHEN OTHERS THEN
        DBMS_OUTPUT.PUT_LINE(' I petty the fool who wrote this');
  END; 
  </code></pre>
  
  <p>I seem to be unable to understand how would one get to use the "INTO" clause in this procedure.
  I'm reading up on the issue and doing some "tests" although I believe it to be great help
  if someone could explain this to me.</p>