1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
10 HREF="mailto:pgsql-docs@postgresql.org"><LINK
12 TITLE="PostgreSQL 7.4.1 Documentation"
13 HREF="index.html"><LINK
15 TITLE="PostgreSQL Client Applications"
16 HREF="reference-client.html"><LINK
19 HREF="app-dropuser.html"><LINK
22 HREF="app-pgconfig.html"><LINK
25 HREF="stylesheet.css"><META
27 CONTENT="2003-12-22T03:48:47"></HEAD
33 SUMMARY="Header navigation table"
43 >PostgreSQL 7.4.1 Documentation</TH
51 HREF="app-dropuser.html"
60 HREF="app-dropuser.html"
73 HREF="app-pgconfig.html"
81 HREF="app-pgconfig.html"
108 > -- embedded SQL C preprocessor</DIV
113 CLASS="REFSYNOPSISDIV"
134 NAME="APP-ECPG-DESCRIPTION"
142 > is the embedded SQL preprocessor for C
143 programs. It converts C programs with embedded SQL statements to
144 normal C code by replacing the SQL invocations with special
145 function calls. The output files can then be processed with any C
152 > will convert each input file given on the
153 command line to the corresponding C output file. Input files
154 preferably have the extension <TT
158 case the extension will be replaced by <TT
162 determine the output file name. If the extension of the input file
166 >, then the output file name is
167 computed by appending <TT
170 > to the full file name.
171 The output file name can also be overridden using the
178 > This reference page does not describe the embedded SQL language.
182 > for more information on that topic.
196 > accepts the following command-line
211 > Automatically generate certain C code from SQL code. Currently, this
228 > Set a compatibility mode. <VAR
252 > Define a C preprocessor symbol.
262 > Parse system include files as well.
275 > Specify an additional include path, used to find files included
278 >EXEC SQL INCLUDE</TT
283 > (current directory),
286 >/usr/local/include</TT
291 > include directory which
292 is defined at compile time (default:
295 >/usr/local/pgsql/include</TT
317 its output to the given <VAR
333 > Selects a run-time behavior. Currently,
351 > Turn on autocommit of transactions. In this mode, each SQL command is
352 automatically committed unless it is inside an explicit
353 transaction block. In the default mode, commands are committed
367 > Print additional information including the version and the
378 > Show a brief summary of the command usage, then exit.
388 > Output version information, then exit.
404 > When compiling the preprocessed C code files, the compiler needs to
405 be able to find the <SPAN
408 > header files in the
412 > include directory. Therefore, one might
416 > option when invoking the compiler
419 >-I/usr/local/pgsql/include</TT
423 > Programs using C code with embedded SQL have to be linked against
427 > library, for example using the
430 >-L/usr/local/pgsql/lib -lecpg</TT
434 > The value of either of these directories that is appropriate for
435 the installation can be found out using <A
436 HREF="app-pgconfig.html"
449 > If you have an embedded SQL C source file named
453 >, you can create an executable
454 program using the following sequence of commands:
456 CLASS="PROGRAMLISTING"
458 cc -I/usr/local/pgsql/include -c prog1.c
459 cc -o prog1 prog1.o -L/usr/local/pgsql/lib -lecpg</PRE
468 SUMMARY="Footer navigation table"
479 HREF="app-dropuser.html"
497 HREF="app-pgconfig.html"
516 HREF="reference-client.html"