Michael Meskes <meskes@postgresql.org> writes:
>>>> Is it possible to get number of updated records using the PQexec command
>>>> and processing the PQresult record?
>>
>> See PQcmdTuples() ...
> For ecpg I've beed using PQntuples(). Is it the same function?
No. PQntuples() is the number of rows in the returned result. It will
always be zero if the SQL command was not SELECT (or FETCH).
PQcmdTuples() is just a dumb little function that looks at the command
status string (the same thing psql prints at the end of a query) and
pulls out the number that appears in "UPDATE n" or "DELETE n" or
"INSERT oid n". Since the questioner asked about updated records,
I assumed that was the number he wanted.
regards, tom lane