|
|
@ -1,5 +1,5 @@ |
|
|
|
<!-- |
|
|
|
<!-- |
|
|
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/ecpg-ref.sgml,v 1.19 2002/04/21 19:02:39 thomas Exp $ |
|
|
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/ecpg-ref.sgml,v 1.20 2002/07/28 15:22:20 petere Exp $ |
|
|
|
PostgreSQL documentation |
|
|
|
PostgreSQL documentation |
|
|
|
--> |
|
|
|
--> |
|
|
|
|
|
|
|
|
|
|
@ -9,6 +9,7 @@ PostgreSQL documentation |
|
|
|
<manvolnum>1</manvolnum> |
|
|
|
<manvolnum>1</manvolnum> |
|
|
|
<refmiscinfo>Application</refmiscinfo> |
|
|
|
<refmiscinfo>Application</refmiscinfo> |
|
|
|
</refmeta> |
|
|
|
</refmeta> |
|
|
|
|
|
|
|
|
|
|
|
<refnamediv> |
|
|
|
<refnamediv> |
|
|
|
<refname> |
|
|
|
<refname> |
|
|
|
<application>ecpg</application> |
|
|
|
<application>ecpg</application> |
|
|
@ -17,6 +18,7 @@ PostgreSQL documentation |
|
|
|
embedded SQL C preprocessor |
|
|
|
embedded SQL C preprocessor |
|
|
|
</refpurpose> |
|
|
|
</refpurpose> |
|
|
|
</refnamediv> |
|
|
|
</refnamediv> |
|
|
|
|
|
|
|
|
|
|
|
<refsynopsisdiv> |
|
|
|
<refsynopsisdiv> |
|
|
|
<refsynopsisdivinfo> |
|
|
|
<refsynopsisdivinfo> |
|
|
|
<date>1999-07-20</date> |
|
|
|
<date>1999-07-20</date> |
|
|
@ -29,14 +31,33 @@ PostgreSQL documentation |
|
|
|
<arg choice="opt">-o <replaceable>outfile</replaceable></arg> |
|
|
|
<arg choice="opt">-o <replaceable>outfile</replaceable></arg> |
|
|
|
<arg choice="plain" rep="repeat"><replaceable>file</replaceable></arg> |
|
|
|
<arg choice="plain" rep="repeat"><replaceable>file</replaceable></arg> |
|
|
|
</cmdsynopsis> |
|
|
|
</cmdsynopsis> |
|
|
|
|
|
|
|
</refsynopsisdiv> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<refsect1 id="APP-ECPG-description"> |
|
|
|
|
|
|
|
<title>Description</title> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
|
|
|
|
<application>ecpg</application> |
|
|
|
|
|
|
|
is an embedded SQL preprocessor for the C language and the |
|
|
|
|
|
|
|
<productname>PostgreSQL</productname>. It |
|
|
|
|
|
|
|
enables development of C programs with embedded SQL code. |
|
|
|
|
|
|
|
</para> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
|
|
|
|
Linus Tolke (<email>linus@epact.se</email>) was the |
|
|
|
|
|
|
|
original author of <application>ecpg</application> (up to version 0.2). |
|
|
|
|
|
|
|
Michael Meskes (<email>meskes@debian.org</email>) |
|
|
|
|
|
|
|
is the current author and maintainer of <application>ecpg</application>. |
|
|
|
|
|
|
|
Thomas Good (<email>tomg@q8.nrnet.org</email>) |
|
|
|
|
|
|
|
is the author of the last revision of the <application>ecpg</application> man page, on which |
|
|
|
|
|
|
|
this document is based. |
|
|
|
|
|
|
|
</para> |
|
|
|
|
|
|
|
</refsect1> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<refsect1> |
|
|
|
|
|
|
|
<title>Options</title> |
|
|
|
|
|
|
|
|
|
|
|
<refsect2 id="R2-APP-ECPG-1"> |
|
|
|
|
|
|
|
<refsect2info> |
|
|
|
|
|
|
|
<date>1999-07-20</date> |
|
|
|
|
|
|
|
</refsect2info> |
|
|
|
|
|
|
|
<title> |
|
|
|
|
|
|
|
Inputs |
|
|
|
|
|
|
|
</title> |
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
|
<application>ecpg</application> accepts the following command |
|
|
|
<application>ecpg</application> accepts the following command |
|
|
|
line arguments: |
|
|
|
line arguments: |
|
|
@ -104,58 +125,23 @@ PostgreSQL documentation |
|
|
|
</varlistentry> |
|
|
|
</varlistentry> |
|
|
|
</variablelist> |
|
|
|
</variablelist> |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
</refsect2> |
|
|
|
</refsect1> |
|
|
|
|
|
|
|
|
|
|
|
<refsect2 id="R2-APP-ECPG-2"> |
|
|
|
|
|
|
|
<refsect2info> |
|
|
|
|
|
|
|
<date>1998-11-05</date> |
|
|
|
|
|
|
|
</refsect2info> |
|
|
|
|
|
|
|
<title> |
|
|
|
|
|
|
|
Outputs |
|
|
|
|
|
|
|
</title> |
|
|
|
|
|
|
|
<para> |
|
|
|
|
|
|
|
<application>ecpg</application> will create a file or |
|
|
|
|
|
|
|
write to <filename>stdout</filename>. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<variablelist> |
|
|
|
|
|
|
|
<varlistentry> |
|
|
|
|
|
|
|
<term>Return value</term> |
|
|
|
|
|
|
|
<listitem> |
|
|
|
|
|
|
|
<para> |
|
|
|
|
|
|
|
<application>ecpg</application> returns 0 to the shell on successful completion, non-zero |
|
|
|
|
|
|
|
for errors. |
|
|
|
|
|
|
|
</para> |
|
|
|
|
|
|
|
</listitem> |
|
|
|
|
|
|
|
</varlistentry> |
|
|
|
|
|
|
|
</variablelist> |
|
|
|
|
|
|
|
</para> |
|
|
|
|
|
|
|
</refsect2> |
|
|
|
|
|
|
|
</refsynopsisdiv> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<refsect1 id="R1-APP-ECPG-description"> |
|
|
|
<refsect1> |
|
|
|
<title>Description</title> |
|
|
|
<title>Exit Status</title> |
|
|
|
<para> |
|
|
|
|
|
|
|
<application>ecpg</application> |
|
|
|
|
|
|
|
is an embedded SQL preprocessor for the C language and the |
|
|
|
|
|
|
|
<productname>PostgreSQL</productname>. It |
|
|
|
|
|
|
|
enables development of C programs with embedded SQL code. |
|
|
|
|
|
|
|
</para> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
|
Linus Tolke (<email>linus@epact.se</email>) was the |
|
|
|
<application>ecpg</application> returns 0 to the shell on |
|
|
|
original author of <application>ecpg</application> (up to version 0.2). |
|
|
|
successful completion, non-zero for errors. |
|
|
|
Michael Meskes (<email>meskes@debian.org</email>) |
|
|
|
|
|
|
|
is the current author and maintainer of <application>ecpg</application>. |
|
|
|
|
|
|
|
Thomas Good (<email>tomg@q8.nrnet.org</email>) |
|
|
|
|
|
|
|
is the author of the last revision of the <application>ecpg</application> man page, on which |
|
|
|
|
|
|
|
this document is based. |
|
|
|
|
|
|
|
</para> |
|
|
|
</para> |
|
|
|
</refsect1> |
|
|
|
</refsect1> |
|
|
|
|
|
|
|
|
|
|
|
<refsect1 id="R1-APP-ECPG-2"> |
|
|
|
|
|
|
|
|
|
|
|
<refsect1> |
|
|
|
<title>Usage</title> |
|
|
|
<title>Usage</title> |
|
|
|
|
|
|
|
|
|
|
|
<refsect2 id="R2-APP-ECPG-preprocessing"> |
|
|
|
<refsect2 id="APP-ECPG-preprocessing"> |
|
|
|
<title>Preprocessing for Compilation</title> |
|
|
|
<title>Preprocessing for Compilation</title> |
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
@ -175,7 +161,7 @@ ecpg [ -d ] [ -o <replaceable>file</replaceable> ] <replaceable>file</replaceabl |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
</refsect2> |
|
|
|
</refsect2> |
|
|
|
|
|
|
|
|
|
|
|
<refsect2 id="R2-APP-ECPG-compiling"> |
|
|
|
<refsect2 id="APP-ECPG-compiling"> |
|
|
|
<title>Compiling and Linking</title> |
|
|
|
<title>Compiling and Linking</title> |
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
@ -190,10 +176,10 @@ gcc -g -I /usr/local/pgsql/include [ -o <replaceable>file</replaceable> ] <repla |
|
|
|
</refsect2> |
|
|
|
</refsect2> |
|
|
|
</refsect1> |
|
|
|
</refsect1> |
|
|
|
|
|
|
|
|
|
|
|
<refsect1 id="R1-APP-ECPG-grammar"> |
|
|
|
<refsect1 id="APP-ECPG-grammar"> |
|
|
|
<title>Grammar</title> |
|
|
|
<title>Grammar</title> |
|
|
|
|
|
|
|
|
|
|
|
<refsect2 id="R2-APP-ECPG-library"> |
|
|
|
<refsect2 id="APP-ECPG-library"> |
|
|
|
<title>Libraries</title> |
|
|
|
<title>Libraries</title> |
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
@ -206,7 +192,7 @@ gcc -g -I /usr/local/pgsql/include [ -o <replaceable>file</replaceable> ] <repla |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
</refsect2> |
|
|
|
</refsect2> |
|
|
|
|
|
|
|
|
|
|
|
<refsect2 id="R2-APP-declaration"> |
|
|
|
<refsect2 id="APP-ecpg-declaration"> |
|
|
|
<title>Variable Declaration</title> |
|
|
|
<title>Variable Declaration</title> |
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
@ -237,7 +223,7 @@ char foo[16], bar[16]; |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
</refsect2> |
|
|
|
</refsect2> |
|
|
|
|
|
|
|
|
|
|
|
<refsect2 id="R2-APP-ECPG-errors"> |
|
|
|
<refsect2 id="APP-ECPG-errors"> |
|
|
|
<title>Error Handling</title> |
|
|
|
<title>Error Handling</title> |
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
@ -292,7 +278,7 @@ EXEC SQL WHENEVER not found sqlprint; |
|
|
|
</note> |
|
|
|
</note> |
|
|
|
</refsect2> |
|
|
|
</refsect2> |
|
|
|
|
|
|
|
|
|
|
|
<refsect2 id="R2-APP-ECPG-connecting"> |
|
|
|
<refsect2 id="APP-ECPG-connecting"> |
|
|
|
<title>Connecting to the Database Server</title> |
|
|
|
<title>Connecting to the Database Server</title> |
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
@ -322,7 +308,7 @@ EXEC SQL CONNECT TO <replaceable>dbname</replaceable>; |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
</refsect2> |
|
|
|
</refsect2> |
|
|
|
|
|
|
|
|
|
|
|
<refsect2 id="R2-APP-ECPG-queries"> |
|
|
|
<refsect2 id="APP-ECPG-queries"> |
|
|
|
<title>Queries</title> |
|
|
|
<title>Queries</title> |
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
@ -393,7 +379,7 @@ EXEC SQL COMMIT; |
|
|
|
</refsect2> |
|
|
|
</refsect2> |
|
|
|
</refsect1> |
|
|
|
</refsect1> |
|
|
|
|
|
|
|
|
|
|
|
<refsect1 id="R1-APP-ECPG-notes"> |
|
|
|
<refsect1 id="APP-ECPG-notes"> |
|
|
|
<title>Notes</title> |
|
|
|
<title>Notes</title> |
|
|
|
<para> |
|
|
|
<para> |
|
|
|
The complete structure definition MUST be listed |
|
|
|
The complete structure definition MUST be listed |
|
|
@ -406,6 +392,17 @@ EXEC SQL COMMIT; |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
|
|
|
|
|
|
|
|
</refsect1> |
|
|
|
</refsect1> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<refsect1> |
|
|
|
|
|
|
|
<title>See Also</title> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
|
|
|
|
<citetitle>PostgreSQL Programmer's Guide</citetitle> for a more |
|
|
|
|
|
|
|
detailed description of the embedded SQL interface. |
|
|
|
|
|
|
|
</para> |
|
|
|
|
|
|
|
</refsect1> |
|
|
|
|
|
|
|
|
|
|
|
</refentry> |
|
|
|
</refentry> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file |
|
|
|
<!-- Keep this comment at the end of the file |
|
|
|