title: FoxPro: Append arbitrary number of views into a single view or table
body: <p>I have several views which I need to combine into a single view or table.  The views all have the same structure and are titled <code>view_1</code>, ..., <code>view_x</code>.</p>
  
  <p>I've had the best luck with the following.  I can get the total number of views in the database, so I have just used <code>12</code> here for simplicity.  The code creates a new view called <code>test</code> and populates it with the contents of <code>view_1</code> as expected.  No errors are thrown when executed.  In the status bar, I see that it has processed XXXX records.  This corresponds to the last view (<code>view_12</code>).  However, <code>test</code> only contains the contents of <code>view_1</code>.</p>
  
  <pre><code>create sql view test as;
  select * ;
  from view_1 
  
  for i = 2 to 12
      insert into test ;
      select * ;
      from view_&amp;i. 
  endfor
  </code></pre>
  
  <p>Am I missing something simple or is there a better way to do this?</p>