1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.152 2004/04/24 00:14:28 momjian Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.153 2004/04/24 22:53:44 neilc Exp $
3
3
-->
4
4
5
5
<chapter id="libpq">
@@ -1941,14 +1941,19 @@ char *PQcmdTuples(PGresult *res);
1941
1941
</para>
1942
1942
1943
1943
<para>
1944
- If the <acronym>SQL</acronym> command that generated the
1945
- <structname>PGresult</structname> was <command>INSERT</>,
1946
- <command>UPDATE</>, <command>DELETE</command>, <command>MOVE</>,
1947
- or <command>FETCH</>, this returns a
1948
- string containing the number of rows affected. If the
1949
- command was anything else, it returns the empty string. The
1950
- caller should not free the result directly. It will be freed
1951
- when the associated <structname>PGresult</> handle is passed to
1944
+ This function returns a string containing the number of rows
1945
+ affected by the <acronym>SQL</> statement that generated the
1946
+ <structname>PGresult</>. This function can only be used
1947
+ following the execution of an <command>INSERT</>,
1948
+ <command>UPDATE</>, <command>DELETE</>, <command>MOVE</>, or
1949
+ <command>FETCH</> statement, or an <command>EXECUTE</> of a
1950
+ prepared query that contains a <command>INSERT</>,
1951
+ <command>UPDATE</>, or <command>DELETE</> statement. If the
1952
+ command that generated the <structname>PGresult</> was
1953
+ anything else, <function>PQcmdTuples</> returns the empty
1954
+ string. The caller should not free the return value
1955
+ directly. It will be freed when the associated
1956
+ <structname>PGresult</> handle is passed to
1952
1957
<function>PQclear</function>.
1953
1958
</para>
1954
1959
</listitem>
@@ -1959,11 +1964,14 @@ char *PQcmdTuples(PGresult *res);
1959
1964
<listitem>
1960
1965
<para>
1961
1966
Returns the OID<indexterm><primary>OID</><secondary>in
1962
- libpq</></> of the inserted row, if the
1963
- <acronym>SQL</acronym> command was an
1964
- <command>INSERT</command> that inserted exactly one row into
1965
- a table that has OIDs. Otherwise, returns
1966
- <literal>InvalidOid</literal>.
1967
+ libpq</></> of the inserted row, if the <acronym>SQL</>
1968
+ command was an <command>INSERT</> that inserted exactly one
1969
+ row into a table that has OIDs, or a <command>EXECUTE</> of
1970
+ a prepared query containing a suitable <command>INSERT</>
1971
+ statement. Otherwise, this function returns
1972
+ <literal>InvalidOid</literal>. This function will also
1973
+ return <literal>InvalidOid</literal> if the table affected
1974
+ by the <command>INSERT</> statement does not contain OIDs.
1967
1975
<synopsis>
1968
1976
Oid PQoidValue(const PGresult *res);
1969
1977
</synopsis>
@@ -1977,7 +1985,9 @@ Oid PQoidValue(const PGresult *res);
1977
1985
<para>
1978
1986
Returns a string with the OID of the inserted row, if the
1979
1987
<acronym>SQL</acronym> command was an
1980
- <command>INSERT</command>. (The string will be
1988
+ <command>INSERT</command> that inserted exactly one row, or
1989
+ a <command>EXECUTE</command> of a prepared statement
1990
+ consisting of a suitable <command>INSERT</command>. (The string will be
1981
1991
<literal>0</> if the <command>INSERT</command> did not
1982
1992
insert exactly one row, or if the target table does not have
1983
1993
OIDs.) If the command was not an <command>INSERT</command>,
0 commit comments