Skip to content

Commit 4b06f6f

Browse files
committed
I found the following useful - just a way of using PQgetisnull from
libpq++. Patrick Welche
1 parent 79434a3 commit 4b06f6f

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/interfaces/libpq++/pgdatabase.cc

Lines changed: 14 additions & 1 deletion
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.3 1999/06/05 18:05:17 tgl Exp $
13+
* $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgdatabase.cc,v 1.4 1999/09/21 21:19:31 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -115,6 +115,18 @@ return PQgetvalue(pgResult, tup_num, FieldNum(field_name));
115115
}
116116

117117

118+
int PgDatabase::GetIsNull(int tup_num, int field_num)
119+
{
120+
return PQgetisnull(pgResult, tup_num, field_num);
121+
}
122+
123+
124+
int PgDatabase::GetIsNull(int tup_num, const char* field_name)
125+
{
126+
return PQgetisnull(pgResult, tup_num, FieldNum(field_name));
127+
}
128+
129+
118130
int PgDatabase::GetLength(int tup_num, int field_num)
119131
{
120132
return PQgetlength(pgResult, tup_num, field_num);
@@ -126,6 +138,7 @@ int PgDatabase::GetLength(int tup_num, const char* field_name)
126138
return PQgetlength(pgResult, tup_num, FieldNum(field_name));
127139
}
128140

141+
129142
int PgDatabase::GetLine(char* string, int length)
130143
{
131144
return PQgetline(pgConn, string, length);

src/interfaces/libpq++/pgdatabase.h

Lines changed: 3 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.2 1999/05/23 01:04:01 momjian Exp $
16+
* $Id: pgdatabase.h,v 1.3 1999/09/21 21:19:31 momjian Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -48,6 +48,8 @@ class PgDatabase : public PgConnection {
4848
short FieldSize(const char* field_name);
4949
const char* GetValue(int tup_num, int field_num);
5050
const char* GetValue(int tup_num, const char* field_name);
51+
int GetIsNull(int tup_num, int field_num);
52+
int GetIsNull(int tup_num, const char* field_name);
5153
int GetLength(int tup_num, int field_num);
5254
int GetLength(int tup_num, const char* field_name);
5355
void DisplayTuples(FILE *out = 0, int fillAlign = 1,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy