title: Oracle Table Variables
body: <p>Using Oracle PL/SQL is there a simple equivalent of the following set of T-SQL statements?  It seems that everything I am finding is either hopelessly outdated or populates a table data type with no explanation on how to use the result other than writing values to stdout.</p>
  
  <pre><code>declare @tempSites table (siteid int) 
  
  insert into @tempSites select siteid from site where state = 'TX'
  
  if 10 &gt; (select COUNT(*) from @tempSites)
  begin 
      insert into @tempSites select siteid from site where state = 'OK'
  end
  
  select * from @tempSites ts inner join site on site.siteId = ts.siteId
  </code></pre>
  
  <p>As @AlexPoole points out in his comment, this is a fairly contrived example. 
  What I am attempting to do is get all sites that meet a certain set of criteria, and if there are not enough matches, then I am looking to use a different set of criteria.  </p>