FNC_GetArrayElementCountの使用例 - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL外部ルーチン プログラミング

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
2019年3月
Language
日本語
Last Update
2019-10-29
dita:mapPath
ja-JP/uhh1512082756414.ditamap
dita:ditavalPath
ja-JP/uhh1512082756414.ditaval
dita:id
B035-1147
Product Category
Software
Teradata Vantage

次の例では、FNC_GetArrayElementCountを使用して、1-D ARRAYに存在する構成要素の数を取得します。

void getNumAryElts ( ARRAY_HANDLE  *phone_ary,
                     INTEGER       *result,
                     char           sqlstate[6])
{
    int presElementsCount;
    int lastElement[1];

    /* Get the number of elements currently stored in the array. */
    FNC_GetArrayElementCount((*phone_ary), &presElementsCount,
       lastElement);
    *result = presElementsCount;
    ...
}

次の例では、FNC_GetArrayElementCount toを呼び出して、n-D ARRAYに存在する構成要素の数を取得します。

void SeismicStations ( ARRAY_HANDLE  *seismic_ary,
                       INTEGER       *result,
                       char           sqlstate[6])
{
    int presElementsCount;
    int lastElement[FNC_ARRAYMAXDIMENSIONS];
    /* Get the number of readings(elements) of seismic_ary. */
    FNC_GetArrayElementCount((*seismic_ary), &presElementsCount,
       lastElement);
    ...
}