mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
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
This commit is contained in:
@ -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:
|
|||||||
~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 @@
|
|||||||
* 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);
|
|||||||
|
|
||||||
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 @@
|
|||||||
* 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 @@
|
|||||||
|
|
||||||
#include "pgconnection.h"
|
#include "pgconnection.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user