Commit 56ba75cb authored by Bruce Momjian's avatar Bruce Momjian

CmdTuples() returns an int showing the number of affected tuples after an

insert, update or delete.  It will return -1 on error, although I've yet
to an error situation to prove that out!


Vince
parent 0eac2922
...@@ -30,7 +30,7 @@ extern "C" { ...@@ -30,7 +30,7 @@ extern "C" {
#include "libpq-fe.h" #include "libpq-fe.h"
} }
static char rcsid[] = "$Id: libpq++.H,v 1.5 1999/10/04 15:17:06 momjian Exp $"; static char rcsid[] = "$Id: libpq++.H,v 1.6 1999/10/06 03:00:16 momjian Exp $";
// **************************************************************** // ****************************************************************
...@@ -79,6 +79,7 @@ public: ...@@ -79,6 +79,7 @@ public:
~PgDatabase() {}; // close connection and clean up ~PgDatabase() {}; // close connection and clean up
// query result access // query result access
int Tuples(); int Tuples();
int CmdTuples();
int Fields(); int Fields();
const char* FieldName(int field_num); const char* FieldName(int field_num);
int FieldNum(const char *field_name); int FieldNum(const char *field_name);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgdatabase.cc,v 1.6 1999/09/28 12:59:29 momjian Exp $ * $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgdatabase.cc,v 1.7 1999/10/06 03:00:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -63,7 +63,12 @@ return PQntuples(pgResult); ...@@ -63,7 +63,12 @@ return PQntuples(pgResult);
int PgDatabase::CmdTuples() int PgDatabase::CmdTuples()
{ {
return PQcmdTuples (pgResult); char *a;
a = (char *)PQcmdTuples(pgResult);
if(NULL == a) return -1;
return atoi(a);
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* *
* $Id: pgdatabase.h,v 1.4 1999/09/28 04:49:22 momjian Exp $ * $Id: pgdatabase.h,v 1.5 1999/10/06 03:00:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "pgconnection.h" #include "pgconnection.h"
#include <stdlib.h>
// **************************************************************** // ****************************************************************
// //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment