Re: Function return number of affected rows

Поиск
Список
Период
Сортировка
От Francisco Figueiredo Jr.
Тема Re: Function return number of affected rows
Дата
Msg-id 420B9122.2090802@yahoo.com.br
обсуждение исходный текст
Ответ на Re: Function return number of affected rows  (Michael Fuhr <mike@fuhr.org>)
Ответы Re: Function return number of affected rows  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-interfaces
Michael Fuhr wrote:
> On Thu, Feb 10, 2005 at 09:34:04AM -0200, Francisco Figueiredo Jr. wrote:
> 
>>I'd like to know if it is possible to get the number of affected rows of
>>an insert, update or delete command inside a function.
> 
> 
> Yes, but how you get that information depends on your client interface.
> With libpq, for example, you could call PQcmdTuples().  If you're using
> something else then see the relevant documentation.
> 

Hi Michael.

Thx for info. I will check what PQcmdTuples is doing.

> 
>>I'd like to know that, because I want to add this support, if possible,
>>to Npgsql.
>>
>>I know the server sends a CompletedResponse message indicating the
>>number of rows affected by a insert update and delete sent directly. But
>>if this is inside a function? Is it possible to get this message too?
> 
> 
> Does Npgsql use its own implemention of the PostgreSQL protocol?
> If so, then that implementation will have to provide the desired
> functionality itself.
> 

Yeap. Npgsql implements protocol itself. This is exactly the problem. 
I'm not receiving the CompletedResponse protocol message when executing 
the insert inside a function. It is through the CompletedResponse 
postgresql server says how many rows were affected. But it seems that 
when calling a function it doesn't return any.

Thanks for your feedback Michael.

Regards,

Francisco Figueiredo Jr.




В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Help with adding C-Language Functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Help with adding C-Language Functions