title: Stata behaviour on macros, different outputs
body: <p>I have a manual list I created in a macro in stata, something like</p>
  
  <pre><code>global list1 "a b c d"
  </code></pre>
  
  <p>which I later iterate through with something like </p>
  
  <pre><code>foreach name in $list1 {
  action
  }
  </code></pre>
  
  <p>I am trying to change this to a DB driven list because the list is getting big and changing quickly, I create a new $list1 with the following commands</p>
  
  <pre><code>odbc load listitems=items, exec("SELECT items  from my_table")  
  levelsof listitems
  global list1=r(levels)
  </code></pre>
  
  <p>The items on each are the same, but this list seems to be different and when I have too many items it break on the for loop with the error</p>
  
  <pre><code>{ required
  r(100);
  </code></pre>
  
  <p>Also, when I run only levelsof listitems I get the output</p>
  
  <pre><code>`"a"' `"b"' `"c"' `"d"' 
  </code></pre>
  
  <p>Which looks a little bit different than the other macros. </p>
  
  <p>I've been stuck in this for a while. Again, it only fails when the number of items becomes large (over 15), any help would be very appreciated.</p>