INCLUDE Statement [ESQL]

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

Quick Links:

Go to Parameters

Go to Usage

Go to Standards

Go to Permissions

Syntax

INCLUDE filename

Parameters

(back to top)

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 Sybase Database product—Supported by Open Client/Open Server.

Permissions

(back to top)

None