16 ClassImp(TPgSQLResult);
21 TPgSQLResult::TPgSQLResult(
void *result)
23 fResult = (PGresult *) result;
24 fRowCount = fResult ? PQntuples(fResult) : 0;
31 TPgSQLResult::~TPgSQLResult()
40 void TPgSQLResult::Close(Option_t *)
54 Bool_t TPgSQLResult::IsValid(Int_t field)
57 Error(
"IsValid",
"result set closed");
60 if (field < 0 || field >= GetFieldCount()) {
61 Error(
"IsValid",
"field index out of bounds");
70 Int_t TPgSQLResult::GetFieldCount()
73 Error(
"GetFieldCount",
"result set closed");
76 return PQnfields(fResult);
82 const char *TPgSQLResult::GetFieldName(Int_t field)
85 Error(
"GetFieldName",
"result set closed");
88 return PQfname(fResult, field);
95 TSQLRow *TPgSQLResult::Next()
100 Error(
"Next",
"result set closed");
104 if (row >= fRowCount)
107 return new TPgSQLRow((
void *) fResult, (ULong_t) row);