Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit56ba75c

Browse files
committed
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 yetto an error situation to prove that out!Vince
1 parent0eac292 commit56ba75c

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

‎src/interfaces/libpq++/libpq++.H

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern "C" {
3030
#include"libpq-fe.h"
3131
}
3232

33-
staticchar rcsid[] ="$Id: libpq++.H,v 1.5 1999/10/04 15:17:06 momjian Exp $";
33+
staticchar rcsid[] ="$Id: libpq++.H,v 1.6 1999/10/06 03:00:16 momjian Exp $";
3434

3535

3636
// ****************************************************************
@@ -79,6 +79,7 @@ public:
7979
~PgDatabase() {};// close connection and clean up
8080
// query result access
8181
intTuples();
82+
intCmdTuples();
8283
intFields();
8384
constchar*FieldName(int field_num);
8485
intFieldNum(constchar *field_name);

‎src/interfaces/libpq++/pgdatabase.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Copyright (c) 1994, Regents of the University of California
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgdatabase.cc,v 1.6 1999/09/28 12:59:29 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgdatabase.cc,v 1.7 1999/10/06 03:00:16 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -63,7 +63,12 @@ return PQntuples(pgResult);
6363

6464
intPgDatabase::CmdTuples()
6565
{
66-
returnPQcmdTuples (pgResult);
66+
char *a;
67+
68+
a = (char *)PQcmdTuples(pgResult);
69+
if(NULL == a)return -1;
70+
71+
returnatoi(a);
6772
}
6873

6974

‎src/interfaces/libpq++/pgdatabase.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Copyright (c) 1994, Regents of the University of California
1414
*
1515
*
16-
* $Id: pgdatabase.h,v 1.4 1999/09/28 04:49:22 momjian Exp $
16+
* $Id: pgdatabase.h,v 1.5 1999/10/06 03:00:16 momjian Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -23,6 +23,7 @@
2323

2424
#include"pgconnection.h"
2525

26+
#include<stdlib.h>
2627

2728
// ****************************************************************
2829
//

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp