You can also declare host variables that are pointers to the supported C and C++ data types, with the following restrictions.
short *mynum; /* Ptr to an integer */ long **mynumptr; /* Ptr to a ptr to a long integer */ char *mychar; /* Ptr to a single character */ char(*mychara)[20]; /* Ptr to a char array of 20 bytes */ struct { /* Ptr to a variable char array of 30 */ short mylen; /* bytes. */ char mydata[30]; } *myvarchar;
char (*a)[10]; /* pointer to a null-terminated char array */ char *a[10]; /* pointer to an array of pointers */
char *mychar; /* This declaration is valid */ char mychar; /* But this one is invalid */
char (*mychara)[20]; /* ptr to char array of 20 bytes */
However, the parentheses are not allowed when the host variable is referenced in an SQL statement, such as a SELECT:
EXEC SQL SELECT name INTO :*mychara FROM mytable;