Host Variable Declaration - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

Product
Preprocessor2 for Embedded SQL
Release Number
15.00
Language
English (United States)
Last Update
2018-09-27
dita:id
B035-2446
lifecycle
previous
Product Category
Teradata Tools and Utilities

Host Variable Declaration

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.