You use INCLUDE to insert program text stored in a PLAM library member into an ESQL program. The program text can contain embedded SQL statements and utility statements, as well as statements in the host language. For example, you could use INCLUDE to insert the communication area between SQL and the host language in an ESQL program, provided that an appropriate member exists in a BS2000 PLAM library.
During precompilation by the ESQL precompiler, the INCLUDE statement is replaced by the text in the specified library member. The INCLUDE statements are processed in the order in which they occur in the program.
INCLUDE
library_member
library_member ::= {
alphanumeric_literal |
regular_name }
library_member
Name of a PLAM library member of the type S. The name must be the valid name of a PLAM library member without a suffix (version specification). If several versions of the specified library member exist in a PLAM library, SESAM/SQL uses the current version.
Allocating PLAM libraries with ESQL precompiler options
Each PLAM library that contains library members must be made known by means of an ESQL precompiler option (see the “ ESQL-COBOL for SESAM/SQL-Server” manual). You use these options to determine the order in which PLAM libraries are searched for library members. If two library members with the same name exist in different PLAM libraries, the ESQL precompiler always uses the first PLAM library encountered that contains this library member.
Example
Insert the library element VARIABLES in an ESQL program. VARIABLES could contain frequently used host variables, for example.
INCLUDE variables