Search Postgresql Archives

Re: Number of updated rows with LibPQ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Laurenz Albe <laurenz.albe@xxxxxxxxxxx> writes:
> On Wed, 2022-10-05 at 16:38 +0200, Dominique Devienne wrote:
>> For selects, I have [PQnTuples][2], but what to do on INSERT, UPDATE, DELETE?
>> Parse the result of PQcmdTuples myself??? If so, what's the 0 in the
>> INSERT below?

> Yes, you have to use PQcmdTuples(), and you have to convert the string to an integer.
> But don't worry: the result will *not* be "INSERT 0 5", it will be just "5", so
> you won't have to parse anything.

Yeah, just applying atoi() or atol() to the result should be enough.

			regards, tom lane






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux