1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpgeasy.sgml,v 2.8 2002/01/07 02:29:12 petere Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpgeasy.sgml,v 2.9 2002/03/04 18:50:20 momjian Exp $
3
3
-->
4
4
5
5
<chapter id="pgeasy">
@@ -11,21 +11,20 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpgeasy.sgml,v 2.8 2002/01/07 02:29
11
11
<para>
12
12
Written by Bruce Momjian
13
13
(<email>pgman@candle.pha.pa.us</email>)
14
- and last updated 2000 -03-30
14
+ and last updated 2002 -03-04
15
15
</para>
16
16
</note>
17
17
18
18
<para>
19
19
<application>pgeasy</application> allows you to cleanly interface
20
20
to the <application>libpq</application> library, more like a 4GL
21
21
SQL interface. Refer to <xref linkend="libpq"> for more
22
- information about <application>libpq</application>
22
+ information about <application>libpq</application>.
23
23
</para>
24
24
25
25
<para>
26
- It consists of set of simplified C functions that encapsulate the
27
- functionality of <application>libpq</application>.
28
- The functions are:
26
+ It consists of a set of simplified C functions that encapsulate the
27
+ functionality of <application>libpq</application>. The functions are:
29
28
30
29
<itemizedlist>
31
30
<listitem>
@@ -88,53 +87,50 @@ void set_result(PGresult *newres);
88
87
</synopsis>
89
88
</listitem>
90
89
91
- <listitem>
92
- <synopsis>
93
- void unset_result(PGresult *oldres);
94
- </synopsis>
95
- </listitem>
96
90
</itemizedlist>
97
91
</para>
98
92
99
93
<para>
100
- Many functions return a structure or value, so you can do more work
94
+ Many functions return a structure or value, so you can work
101
95
with the result if required.
102
96
</para>
103
97
104
98
<para>
105
- You basically connect to the database with <function>connectdb</function>,
106
- issue your query with <function>doquery</function>,
107
- fetch the results with <function>fetch</function>,
108
- and finish with <function>disconnectdb</function>.
99
+ You basically connect to the database with
100
+ <function>connectdb</function>, issue your query with
101
+ <function>doquery</function>, fetch the results with
102
+ <function>fetch</function>, and finish with
103
+ <function>disconnectdb</function>.
109
104
</para>
110
105
111
106
<para>
112
107
For <literal>SELECT</literal> queries, <function>fetch</function>
113
- allows you to pass pointers as parameters, and on return the variables
114
- are filled with data from the binary cursor you opened. These binary
115
- cursors cannot be used if you are running the
116
- <application>pgeasy</application>
117
- client on a system with a different architecture than the database
118
- server. If you pass a NULL pointer parameter, the column is skipped.
119
- <function>fetchwithnulls</function> allows you to retrieve the NULL
120
- status of the field by passing an <literal>int*</literal>
121
- after each result pointer, which returns true or false if the field is null.
122
- You can always use <application>libpq</application> functions on the <structname>PGresult</structname> pointer returned
123
- by <function>doquery</function>.
124
- <function>reset_fetch</function> starts the fetch back at the beginning.
108
+ allows you to pass pointers as parameters, and on return the
109
+ variables are filled with data from the binary cursor you opened.
110
+ These binary cursors cannot be used if you are running the
111
+ <application>pgeasy</application> client on a system with a different
112
+ architecture than the database server. If you pass a NULL pointer
113
+ parameter, the column is skipped. <function>fetchwithnulls</function>
114
+ allows you to retrieve the NULL status of the field by passing an
115
+ <literal>int*</literal> after each result pointer, which returns true
116
+ or false to indicate if the field is null. You can always use
117
+ <application>libpq</application> functions on the
118
+ <structname>PGresult</structname> pointer returned by
119
+ <function>doquery</function>. <function>reset_fetch</function> starts
120
+ the fetch back at the beginning.
125
121
</para>
126
122
127
123
<para>
128
- <function>get_result</function>,
129
- <function>set_result</function>,
130
- and
131
- <function>unset_result </function>
132
- allow you to handle multiple result sets at the same time .
124
+ <function>get_result</function> and <function>set_result</function>
125
+ allow you to handle multiple open result sets. Use
126
+ <function>get_result</function> to save a result into an application
127
+ variable. You can then later use <function>set_result </function> to
128
+ return to the previously save result .
133
129
</para>
134
130
135
131
<para>
136
- There are several demonstration programs in the
137
- source directory .
132
+ There are several demonstration programs in
133
+ <filename>pgsql/src/interfaces/libpgeasy/examples</> .
138
134
</para>
139
135
</chapter>
140
136
0 commit comments