C++ code - PGRES_TUPLES_OK is not returned when DELETE performed - Mailing list pgsql-general

From Yan Cheng CHEOK
Subject C++ code - PGRES_TUPLES_OK is not returned when DELETE performed
Date
Msg-id 449354.85969.qm@web65706.mail.ac4.yahoo.com
Whole thread Raw
Responses Re: C++ code - PGRES_TUPLES_OK is not returned when DELETE performed  (Dmitriy Igrishin <dmitigr@gmail.com>)
List pgsql-general
I realize for the following code :

PGconn *connection = this->connection.getConnection();
PGresult *res = PQexec(connection, "DELETE FROM measurement_statistic WHERE fk_lot_id = 47");

// status always false??
const bool status = (PQresultStatus(res) == PGRES_TUPLES_OK);

status will always remain false, although the actual row in database had been delete.

I execute the above statement (DELETE FROM measurement_statistic WHERE fk_lot_id = 47) through pgadmin. It works fine.

May I know why PGRES_TUPLES_OK is not being returned when I use DELETE? When I try to execute SELECT statement,
PGRES_TUPLES_OKcan be returned. 

Thanks and Regards
Yan Cheng CHEOK




pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Understanding Schema's
Next
From: "Andrus Moor"
Date:
Subject: How to restore from backup to 8.4.3 server using 9.0 dump/restore