11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003 /12/26 20:00:00 meskes Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.60 2004 /12/28 22:47:15 tgl Exp $
33-->
44
55<chapter id="ecpg">
@@ -19,7 +19,7 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp
1919 </para>
2020
2121 <para>
22- Admittedly, this documentation is quite incomplete. But since this
22+ This documentation is quite incomplete. But since this
2323 interface is standardized, additional information can be found in
2424 many resources about SQL.
2525 </para>
@@ -31,9 +31,9 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp
3131 An embedded SQL program consists of code written in an ordinary
3232 programming language, in this case C, mixed with SQL commands in
3333 specially marked sections. To build the program, the source code
34- is first passedto the embedded SQL preprocessor, which converts it
34+ is first passedthrough the embedded SQL preprocessor, which converts it
3535 to an ordinary C program, and afterwards it can be processed by a C
36- compilation tool chain .
36+ compiler .
3737 </para>
3838
3939 <para>
@@ -53,16 +53,16 @@ $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.59 2003/12/26 20:00:00 meskes Exp
5353 </para>
5454
5555 <para>
56- Asindicated , programs written for the embedded
56+ Asalready stated , programs written for the embedded
5757 <acronym>SQL</acronym> interface are normal C programs with special
5858 code inserted to perform database-related actions. This special
5959 code always has the form
6060<programlisting>
6161EXEC SQL ...;
6262</programlisting>
6363 These statements syntactically take the place of a C statement.
64- Depending on the particular statement, they may appearin the
65- globalcontext or within a function. Embedded
64+ Depending on the particular statement, they may appearat the
65+ globallevel or within a function. Embedded
6666 <acronym>SQL</acronym> statements follow the case-sensitivity rules
6767 of normal <acronym>SQL</acronym> code, and not those of C.
6868 </para>
@@ -326,9 +326,9 @@ EXEC SQL COMMIT;
326326 <para>
327327 In the default mode, statements are committed only when
328328 <command>EXEC SQL COMMIT</command> is issued. The embedded SQL
329- interface also supports autocommit of transactions (as known from
330- other interfaces ) via the <option>-t</option> command-line option
331- to <command>ecpg</command> (see below) or via the <literal>EXEC SQL
329+ interface also supports autocommit of transactions (similar to
330+ <application>libpq</> behavior ) via the <option>-t</option> command-line
331+ option to <command>ecpg</command> (see below) or via the <literal>EXEC SQL
332332 SET AUTOCOMMIT TO ON</literal> statement. In autocommit mode, each
333333 command is automatically committed unless it is inside an explicit
334334 transaction block. This mode can be explicitly turned off using
@@ -448,7 +448,7 @@ char foo[16], bar[16];
448448 <para>
449449 The declarations are also echoed to the output file as a normal C
450450 variables, so there's no need to declare them again. Variables
451- that are not intended to be usedwith SQL commands can be declared
451+ that are not intended to be usedin SQL commands can be declared
452452 normally outside these special sections.
453453 </para>
454454
553553 second host variable specification to each host variable that
554554 contains data. This second host variable is called the
555555 <firstterm>indicator</firstterm> and contains a flag that tells
556- whether thedatums is null, in which case the value of the real
556+ whether thedatum is null, in which case the value of the real
557557 host variable is ignored. Here is an example that handles the
558558 retrieval of null values correctly:
559559<programlisting>
@@ -1043,7 +1043,7 @@ static void set_error_handler(void)
10431043 <title>sqlca</title>
10441044
10451045 <para>
1046- Fora more powerful error handling, the embedded SQL interface
1046+ For more powerful error handling, the embedded SQL interface
10471047 provides a global variable with the name <varname>sqlca</varname>
10481048 that has the following structure:
10491049<programlisting>
@@ -1064,7 +1064,7 @@ struct
10641064} sqlca;
10651065</programlisting>
10661066 (In a multithreaded program, every thread automatically gets its
1067- own copy of <varname>sqlca</varname>. This workssimilar to the
1067+ own copy of <varname>sqlca</varname>. This workssimilarly to the
10681068 handling of the standard C global variable
10691069 <varname>errno</varname>.)
10701070 </para>
@@ -1132,7 +1132,7 @@ struct
11321132 <para>
11331133 The structure <varname>sqlca</varname> is not defined in the SQL
11341134 standard, but is implemented in several other SQL database
1135- systems. The definitions are similarin the core, but if you want
1135+ systems. The definitions are similarat the core, but if you want
11361136 to write portable applications, then you should investigate the
11371137 different implementations carefully.
11381138 </para>
@@ -1539,7 +1539,7 @@ ecpg prog1.pgc
15391539<programlisting>
15401540cc -c prog1.c
15411541</programlisting>
1542- The generated C source files includeheaders files from the
1542+ The generated C source files includeheader files from the
15431543 <productname>PostgreSQL</> installation, so if you installed
15441544 <productname>PostgreSQL</> in a location that is not searched by
15451545 default, you have to add an option such as
@@ -1575,9 +1575,9 @@ ECPG = ecpg
15751575 </para>
15761576
15771577 <para>
1578- <application>ecpg</application> is thread-safe if it iscompiled using
1579- the <option>--enable-thread-safety</><filename>configure</filename>
1580- command-line option . (You might need to use other threading
1578+ The <application>ecpg</application>library is thread-safe if it isbuilt
1579+ using the <option>--enable-thread-safety</>command-line option to
1580+ <filename>configure</filename> . (You might need to use other threading
15811581 command-line options to compile your client code.)
15821582 </para>
15831583 </sect1>
@@ -1621,7 +1621,7 @@ ECPG = ecpg
16211621 <title>Internals</title>
16221622
16231623 <para>
1624- This sectionexplain how <application>ECPG</application> works
1624+ This sectionexplains how <application>ECPG</application> works
16251625 internally. This information can occasionally be useful to help
16261626 users understand how to use <application>ECPG</application>.
16271627 </para>