Search code examples
arraysteradataudf

Array defintion in Teradata Aggregate UDF


I'm trying to create a Aggregate UDF function in teradata.

As a part of it im trying to decalre an array in intermediate storage.

It keeps on throwing the below error when im trying to link it to teradata.

Executed as Single statement.  Failed [7504 : HY000] in UDF/XSP/UDM DBC.IRR: SQLSTATE U0001: 
Elapsed time = 00:00:01.628 

STATEMENT 1: Select Statement failed. 

Here is my code which im incorporating the array.

Is there any thing wrong with the syntax?

#include <sqltypes_td.h>
#include <string.h>
#include <math.h>
typedef struct agr_storage {
        FLOAT count;
        FLOAT val1,val2,val3,val4;
    FLOAT res[100]; // This is my array
} AGR_Storage;

Solution

  • Teradata limits each intermediate block size to 64 bytes and in the above code , we are trying to declare a array of size 800 bytes.

    This is the reason for error.