Documentation
 
 
 

28.3. ecpg Command

28.3.1. Name

ecpg--embedded SQL C preprocessor

28.3.2. Synopsis

ecpg [ option... ] filename...

28.3.3. Options

ecpg accepts the following command-line arguments:

-c

Automatically generate certain C code from SQL code. Currently, this works for EXEC SQL TYPE.

-C mode

Set a compatibility mode. Mode may be INFORMIX or INFORMIX_SE.

-D symbol

Define a C preprocessor symbol.

-i

Parse system include files as well.

-I directory

Specify an additional include path, used to find files included via EXEC SQL INCLUDE. Defaults are (current directory), the EnterpriseDB include directory which is defined at compile time

(default: /opt/EnterpriseDB/8.2/dbserver/include/)

-o filename

Specifies that ecpg should write all its output to the given filename.

-r option

Selects a run-time behavior. Currently, option can only be no_indicator.

-t

Turn on autocommit of transactions. In this mode, each SQL command is automatically committed unless it is inside an explicit transaction block. In the default mode, commands are committed only when EXEC SQL COMMIT is issued.

-v

Print additional information including the version and the include path.

--help

Show a brief summary of the command usage, then exit.

--version

Output version information, then exit.

28.3.4. Notes

When compiling the preprocessed C code files, the compiler needs to be able to find the ECPG header files in the EnterpriseDB include directory. Therefore, one might have to use the -I option when invoking the compiler

(e.g., -I opt/EnterpriseDB/8.2/dbserver/include/)

.

Programs using C code with embedded SQL have to be linked against the -lpgtypes library, for example using the linker options:

(e.g. -L /opt/EnterpriseDB/8.2/dbserver/lib -lpgtypes).
 
 ©2004-2007 EnterpriseDB All Rights Reserved