ROOT  6.06/09
Reference Guide
TPgSQLRow.h
Go to the documentation of this file.
1 // @(#)root/pgsql:$Id$
2 // Author: g.p.ciceri <gp.ciceri@acm.org> 01/06/2001
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TPgSQLRow
13 #define ROOT_TPgSQLRow
14 
15 #ifndef ROOT_TSQLRow
16 #include "TSQLRow.h"
17 #endif
18 
19 #if !defined(__CINT__)
20 #include <libpq-fe.h>
21 #else
22 struct PGresult;
23 typedef char **PGresAttValue;
24 #endif
25 
26 
27 class TPgSQLRow : public TSQLRow {
28 
29 private:
30  PGresult *fResult; // current result set
31  ULong_t fRowNum; // row number
32 
33  Bool_t IsValid(Int_t field);
34 
35 public:
36  TPgSQLRow(void *result, ULong_t rowHandle);
37  ~TPgSQLRow();
38 
39  void Close(Option_t *opt="");
41  const char *GetField(Int_t field);
42 
43  ClassDef(TPgSQLRow,0) // One row of PgSQL query result
44 };
45 
46 #endif
Bool_t IsValid(Int_t field)
Check if row is open and field index within range.
Definition: TPgSQLRow.cxx:50
TPgSQLRow(void *result, ULong_t rowHandle)
const char Option_t
Definition: RtypesCore.h:62
const char * GetField(Int_t field)
Get specified field from row (0 <= field < GetFieldCount()).
Definition: TPgSQLRow.cxx:80
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
~TPgSQLRow()
Destroy row object.
Definition: TPgSQLRow.cxx:29
void Close(Option_t *opt="")
Close row.
Definition: TPgSQLRow.cxx:38
#define ClassDef(name, id)
Definition: Rtypes.h:254
PGresult * fResult
Definition: TPgSQLRow.h:30
unsigned long ULong_t
Definition: RtypesCore.h:51
double result[121]
ULong_t fRowNum
Definition: TPgSQLRow.h:31
ULong_t GetFieldLength(Int_t field)
Get length in bytes of specified field.
Definition: TPgSQLRow.cxx:62