title: Insert result of select statement to another table in Oracle stored procedure
body: <p>I am preparing a stored procedure in oracle. In this procedure I have a select statement which will result in multiple rows. Now I want to insert these rows to another table.</p>
  
  <p>Please someone tell me it is really urgent.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>One thing that I forgot to mention is that I also have to add another column in my result of select statement. This column will contain value of a parameter in this stored procedure.</p>
  
  <p>Below is the sample stored procedure for this</p>
  
  <pre><code>Create or Replace PROCEDURE "My Procedure" 
    (
      my_id in number,
      nric in VARCHAR2
    )
  BEGIN
  insert into new_table(my_new_id,field1, field2)
  select my_id,table1.field1, table2.field2 
  from table1, table2 
  where table1.age=table2.age AND table1.my_nric=nric;
  END
  </code></pre>
  
  <p>In above sample I have my_id in procedure parameter and want to insert that in new_table for each result entry from table1 and table2.</p>