title: Using the data from a for loop as a table in the From in a Select
body: <p>I am converting some code in Access over to Oracle, and one of the queries in Access uses a table that I am unable to use in Oracle. I am unable to create new tables, so I am trying to figure out a way to use the logic behind the table in the FOR section of my select. </p>
  
  <p>The logic of the table is similar to:</p>
  
  <pre><code>FOR i = 1 To 100
      number = number + 1
      .AddNew
      !tbl_number = number
  NEXT i
  </code></pre>
  
  <p>I'm trying to convert this to oracle, and so far I have:</p>
  
  <pre><code>FOR i in 1 .. 100 LOOP
     number := number + 1;
     --This is where I am stuck; How do I simulate the table part
  END LOOP;
  </code></pre>
  
  <p>I was thinking a cursor or a record would be the answer, but I can't seem to figure out how to implement that. In the end I basically want to have:</p>
  
  <pre><code>SELECT
     table.number
  FROM
     (
       --My for loop logic
     ) table
  </code></pre>
  
  <p><em>EDIT</em></p>
  
  <p>The calculation is a bit more complicated; that was just an example. They aren't actually sequential, and there isn't really a pattern to rows.</p>
  
  <p><em>EDIT</em></p>
  
  <p>Here is a more complicated version of the for loop which is closer to what I'm actually doing:</p>
  
  <pre><code>FOR i in 1 .. 100 LOOP
  
     number1 := number1 + 7;
     number2 := (number2 + 8) / number1;
     --This is where I am stuck; How do I simulate the table part
  END LOOP;
  </code></pre>