title: SQLScript: scalar type is not allowed
body: <p>I have the following sql command:</p>
  
  <pre><code>SELECT DFT(weighted, 32768 ORDER BY rel_id).REAL as four FROM :fith
  </code></pre>
  
  <p>This function returns an array with 32769 elements in one cell.<a href="https://i.stack.imgur.com/APUdw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/APUdw.png" alt="enter image description here"></a> </p>
  
  <p>Now I want to use the <code>unnest</code>function to split the result. Therefore I need to save the results in a variable.</p>
  
  <p>The following command throws an error:</p>
  
  <pre><code>my_array = SELECT DFT(weighted, 32768 ORDER BY rel_id).REAL as four FROM :fith;
  ===&gt;    invalid datatype: Column FOUR of table variable MY_ARRAY has an unsupported data type (ARRAY)
  </code></pre>
  
  <p>Well okay... after the declaration of my <code>my_array</code> to an array, I'm getting this error:</p>
  
  <pre><code>    declare my_array double array;
      my_array = SELECT DFT(weighted, 32768 ORDER BY rel_id).REAL as four FROM :fith;
  ==&gt;scalar type is not allowed: MY_ARRAY:
  </code></pre>
  
  <p>Why do I want to do this over such a detour?
  The documentation says: </p>
  
  <blockquote>
    <p>The UNNEST function cannot be referenced directly in a FROM clause of
    a SELECT statement</p>
  </blockquote>
  
  <p>Whats wrong? What can I do now?</p>