From 46651ce6fe013220ed397add242004d764fc0153 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:15:05 +0200 Subject: Adding upstream version 14.5. Signed-off-by: Daniel Baumann --- doc/src/sgml/ref/ecpg-ref.sgml | 278 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 doc/src/sgml/ref/ecpg-ref.sgml (limited to 'doc/src/sgml/ref/ecpg-ref.sgml') diff --git a/doc/src/sgml/ref/ecpg-ref.sgml b/doc/src/sgml/ref/ecpg-ref.sgml new file mode 100644 index 0000000..f3b6034 --- /dev/null +++ b/doc/src/sgml/ref/ecpg-ref.sgml @@ -0,0 +1,278 @@ + + + + + ecpg + + + + ecpg + 1 + Application + + + + ecpg + embedded SQL C preprocessor + + + + + ecpg + option + file + + + + + + Description + + + ecpg is the embedded SQL preprocessor for C + programs. It converts C programs with embedded SQL statements to + normal C code by replacing the SQL invocations with special + function calls. The output files can then be processed with any C + compiler tool chain. + + + + ecpg will convert each input file given on the + command line to the corresponding C output file. If an input file + name does not have any extension, .pgc is + assumed. The file's extension will be replaced + by .c to construct the output file name. + But the output file name can be overridden using the + option. + + + + If an input file name is just -, + ecpg reads the program from standard input + (and writes to standard output, unless that is overridden + with ). + + + + This reference page does not describe the embedded SQL language. + See for more information on that topic. + + + + + + Options + + + ecpg accepts the following command-line + arguments: + + + + + + + Automatically generate certain C code from SQL code. Currently, this + works for EXEC SQL TYPE. + + + + + + + + + Set a compatibility mode. mode can + be INFORMIX, + INFORMIX_SE, or ORACLE. + + + + + + + + + Define a C preprocessor symbol. + + + + + + + + + Process header files. When this option is specified, the output file + extension becomes .h not .c, + and the default input file extension is .pgh + not .pgc. Also, the option is + forced on. + + + + + + + + + Parse system include files as well. + + + + + + + + + Specify an additional include path, used to find files included + via EXEC SQL INCLUDE. Defaults are + . (current directory), + /usr/local/include, the + PostgreSQL include directory which + is defined at compile time (default: + /usr/local/pgsql/include), and + /usr/include, in that order. + + + + + + + + + Specifies that ecpg should write all + its output to the given filename. + Write -o - to send all output to standard output. + + + + + + + + + Selects run-time behavior. Option can be + one of the following: + + + + + + Do not use indicators but instead use special values to represent + null values. Historically there have been databases using this approach. + + + + + + + + Prepare all statements before using them. Libecpg will keep a cache of + prepared statements and reuse a statement if it gets executed again. If the + cache runs full, libecpg will free the least used statement. + + + + + + + + Allow question mark as placeholder for compatibility reasons. + This used to be the default long ago. + + + + + + + + + + + + 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. + + + + + + + + + Print additional information including the version and the + "include" path. + + + + + + + + + Print the ecpg version and exit. + + + + + + + + + + Show help about ecpg command line + arguments, and exit. + + + + + + + + + + + Notes + + + When compiling the preprocessed C code files, the compiler needs to + be able to find the ECPG header files in the + PostgreSQL include directory. Therefore, you might + have to use the option when invoking the compiler + (e.g., -I/usr/local/pgsql/include). + + + + Programs using C code with embedded SQL have to be linked against + the libecpg library, for example using the + linker options -L/usr/local/pgsql/lib -lecpg. + + + + The value of either of these directories that is appropriate for + the installation can be found out using . + + + + + + Examples + + + If you have an embedded SQL C source file named + prog1.pgc, you can create an executable + program using the following sequence of commands: + +ecpg prog1.pgc +cc -I/usr/local/pgsql/include -c prog1.c +cc -o prog1 prog1.o -L/usr/local/pgsql/lib -lecpg + + + + -- cgit v1.2.3