Updated on 2024-06-03 GMT+08:00

Including Files

To include an external file in an embedded SQL program, use the following statements:
EXEC SQL INCLUDE filename;
EXEC SQL INCLUDE <filename>;
EXEC SQL INCLUDE "filename";
  • ECPG searches for files in the following sequence:
    1. Current directory
    2. /usr/local/include
    3. GaussDB Kernel directory, which is defined at build time
    4. /usr/include
  • When EXEC SQL INCLUDE "filename" is used, only the current directory is searched.
  • In each directory, ECPG will first look for the file name as given, and if not found will append .h to the file name and try again (unless the specified file name already has that suffix).
  • The file name is case sensitive.