hi
im having a problem while using the PQcmdTuples(). Consider the following
code snippet:
there exists a table table1 (name character(30), age integer)
<...snip...>
PGresult *res = PQexec("prepare p_stmt (integer) update table1 set age = age
+ 1 where age = $1");
PQclear (res);
res = PQexec ( execute p_stmt (10));
cout<<PQcmdTuples (res);
<...snip...>
the PQcmdTuples() returns a null string. The doc says it returns number of
affected tuples if the statement is INSERT, UPDATE or DELETE. This
apparently doesn't include statements.
Now consider this...
name age
----- ----
a 1
b 2
update table1 set age=age + 1 where age = 3;
this does not return an error even though no tuples were were affected.
Now my problem is this.....
either
1> i need the number of affected rows in the update operation
OR
2> i need to get whether the update did or did not affect a tuple (no tuple
was matched by the where clause). In my case, at max, 1 tuple will be
affected.
any of these will solve the problem
thanx in advance
rahul