avatar image
Former Member

How can I handle sql functions which returning arrays?

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 07, 2016 at 02:01 PM

    Hello Tobias,

    your last statement is the correct one. As you asked in another question UNNEST has no limitation.

    In which evironment do you execute the statement? In the SQL console or somewhere else?

    Regards,
    Florian

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Florian,

      could you tell me how i can save the array fom the dft function (see my errors)?

      After the HCP Trial Database updatet to the newest version I'm getting the same error as before.. :/

Skip to Content