Skip to Content
0
Former Member
Dec 06, 2016 at 02:14 PM

How can I handle sql functions which returning arrays?

188 Views Last edit Dec 06, 2016 at 02:14 PM 2 rev

Hi,

I want to use the function "DFT" in my stored procedure.
DFT is returning an array. How can I handle with the result?

The following query produce an error:

test = select dft(valll, 32768 order by dates).phase from :var5;
==> invalid datatype: Column DFT(valll,32768ORDERBYDATES) of table variable TEST has an unsupported data type (ARRAY)

After the declaration I'm getting this error:

declare test double array;test = select dft(valll, 32768 order by dates).phase from :var5;==>scalar type is not allowed: TEST:

I want to use the results of the DFT function.

I tried this one but this just returns 1024 items...

select 
PHASE 
from UNNEST(
(SELECT DFT(valll, 32768 ORDER BY dates).PHASE FROM :var5)
) AS UNNESTED_DFT("PHASE");

Thanks!

Tobias