15.10 - Host Variable Declaration - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

prodname
Preprocessor2 for Embedded SQL
vrm_release
15.10
category
Programming Reference
featnum
B035-2446-035K

Use the following C type specifiers and declarations to define a host variable declaration:

auto
char
double
extern
float
int
long
short
static
struct (excluding tag type definitions)
unsigned char

A host variable that is defined as a “long” data type will be 4 bytes when compiled with the 32‑bit compiler option and 8 bytes when compiled with the 64‑bit compiler options on the Solaris, HP‑UX, AIX or 64‑bit Windows platforms.

When generating SQLDA for the static SQL statement, the PP2 precompiler assigns:

  • SQLTYPE to the INTEGER data type
  • SQLLEN to “sizeof(long)”
  • The following C type specifiers and declarations cannot be used to declare a host variable:

    #define
    enum
    pointer designation (char *var1)
    register
    structure definition via tags
    typedef
    union
    unsigned integer types
    void

    Specify C array dimensions by a numeric literal. Defined constants or numeric expressions are not allowed within a C array declaration.