A host variable must be defined in the program in a DECLARE SECTION in accordance with programming language conventions. The location of the definition and use of a host variable must satisfy the following conditions:
In the program text, a variable must be defined before it is used in an SQL statement.
The definition must be valid, with regard to programming language conventions, for any use to which the variable may be put in an SQL or host language statement.
The definition of a variable that is used in a DECLARE CURSOR statement defining a cursor must be valid for all OPEN statements of the defined cursor.
The data type of the host variable depends on the data type of the SESAM/SQL values for which this host variable is to be used. The ESQL language interface provides predefined data types that must be used for host variables. The assigned COBOL data type is specified for each SESAM/SQL data type in the “ ESQL-COBOL for SESAM/SQL-Server” manual.