- If the
SQL command that generated the
- PGresult was INSERT>,
- UPDATE>, DELETE, MOVE>,
- or FETCH>, this returns a
- string containing the number of rows affected. If the
- command was anything else, it returns the empty string. The
- caller should not free the result directly. It will be freed
- when the associated PGresult> handle is passed to
+ This function returns a string containing the number of rows
+ affected by the
SQL> statement that generated the
+ PGresult>. This function can only be used
+ following the execution of an INSERT>,
+ UPDATE>, DELETE>, MOVE>, or
+ FETCH> statement, or an EXECUTE> of a
+ prepared query that contains a INSERT>,
+ UPDATE>, or DELETE> statement. If the
+ command that generated the PGresult> was
+ anything else, PQcmdTuples> returns the empty
+ string. The caller should not free the return value
+ directly. It will be freed when the associated
+ PGresult> handle is passed to
PQclear.
- libpq>> of the inserted row, if the
- INSERT that inserted exactly one row into
- a table that has OIDs. Otherwise, returns
- InvalidOid.
+ libpq>> of the inserted row, if the
SQL>
+ command was an INSERT> that inserted exactly one
+ row into a table that has OIDs, or a EXECUTE> of
+ a prepared query containing a suitable INSERT>
+ statement. Otherwise, this function returns
+ InvalidOid. This function will also
+ return InvalidOid if the table affected
+ by the INSERT> statement does not contain OIDs.
Oid PQoidValue(const PGresult *res);
Returns a string with the OID of the inserted row, if the
- INSERT. (The string will be
+ INSERT that inserted exactly one row, or
+ a EXECUTE of a prepared statement
+ consisting of a suitable INSERT. (The string will be
0> if the INSERT did not
insert exactly one row, or if the target table does not have
OIDs.) If the command was not an INSERT,