Show TOC

INCLUDE Statement [ESQL]Locate this document in the navigation structure

Includes a file into a source program to be scanned by the SQL source language preprocessor.

Syntax
INCLUDE <filename>
Parameters

(back to top)

  • filename

    identifier

Usage

(back to top)

The INCLUDE statement is very much like the C preprocessor #include directive.

However, the SQL preprocessor reads the given file, inserting its contents into the output C file. Thus, if an include file contains information that the SQL preprocessor requires, it should be included with the Embedded SQL INCLUDE statement.

Two file names are specially recognized: SQLCA and SQLDA. Any C program using Embedded SQL must contain this statement before any Embedded SQL statements:

EXEC SQL INCLUDE SQLCA;

This statement must appear at a position in the C program where static variable declarations are allowed. Many Embedded SQL statements require variables (invisible to the programmer) which are declared by the SQL preprocessor at the position of the SQLCA include statement. The SQLDA file must be included if any SQLDAs are used.

Standards

(back to top)

  • SQL—ISO/ANSI SQL compliant.
  • SAP Database products—Supported by Open Client/Open Server.
Permissions