Collection Contents Index DEALLOCATE DESCRIPTOR statement [ESQL] DECLARE statement pdf/chap9.pdf

Reference Manual
   CHAPTER 9. SQL Statements     

Declaration section [ESQL]


Function 

To declare host variables in an Embedded SQL program. Host variables are used to exchange data with the database.

Syntax 

EXEC SQL BEGIN DECLARE SECTION;
...C declarations
EXEC SQL END DECLARE SECTION;

Permissions 

None.

See also 

BEGIN... END statement

Description 

A declaration section is simply a section of C variable declarations surrounded by the BEGIN DECLARE SECTION and END DECLARE SECTION statements. A declaration section makes the SQL preprocessor aware of C variables that will be used as host variables. Not all C declarations are valid inside a declaration section. See Using host variables for more information.

Standards and compatibility 

Examples 

EXEC SQL BEGIN DECLARE SECTION;
char *emp_lname, initials[5];
int dept;
EXEC SQL END DECLARE SECTION;

Collection Contents Index DEALLOCATE DESCRIPTOR statement [ESQL] DECLARE statement pdf/chap9.pdf