Array insert support in embedded sql with C language

General
Teradata Employee

Array insert support in embedded sql with C language

Given the Teradata documentation (Teradata Preprocessor2 for embedded SQL Programmer guide, Release 14.10),

to insert array of data the EXEC SQL statement is modified to:

EXEC SQL FOR (<countval) <sql statement string>

where countval is a user defined integer variable or literal integer constant that must be

less than or equal to the smallest defined dimension in the list of arrays

An example is provided to illustrate the case:

EXEC SQL BEGIN DECLARE SECTION;

char empname[50][20];

long empnum[50];

float empsal[50];

long cNewEmployees = 50;

EXEC SQL END DECLARE SECTION;

EXEC SQL PREPARE exInsert01 FROM insert into employee values (?, ?, ?);

EXEC SQL FOR cNewE example?

mployees

    EXECUTE exInsert01 USING :empname, :empnum, :empsal;

This example for array insert in embedded sql with C language is not working. Only the first element in each array is inserted.

Is there something missed or special options to set at the C compiler to run this example.

Tags (1)