ROOT  6.06/09
Reference Guide
TSapDBResult.h
Go to the documentation of this file.
1 // @(#)root/sapdb:$Id$
2 // Author: Mark Hemberger & Fons Rademakers 03/08/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_TSapDBResult
13 #define ROOT_TSapDBResult
14 
15 #ifndef ROOT_TSQLResult
16 #include "TSQLResult.h"
17 #endif
18 
19 #if !defined(__CINT__)
20 #include <sys/time.h>
21 #include <WINDOWS.H>
22 #ifdef min
23 #undef min
24 #endif
25 #ifdef max
26 #undef max
27 #endif
28 #include <sql.h>
29 #include <sqlext.h>
30 #else
31 typedef long int SDWORD;
32 typedef long SQLHSTMT;
33 #endif
34 
35 class TString;
36 
37 
38 class TSapDBResult : public TSQLResult {
39 
40 private:
41  SQLHSTMT fResult; // query result (rows)
42  TString *fFieldNames; // names of fields
43  Int_t fFieldCount; // number of fields
44 
45  Bool_t IsValid(Int_t field);
46 
47 public:
48  TSapDBResult(SQLHSTMT fStmt, SDWORD rowCount = 0);
49  ~TSapDBResult();
50 
51  void Close(Option_t *opt="");
53  const char *GetFieldName(Int_t field);
54  TSQLRow *Next();
55 
56  ClassDef(TSapDBResult,0) // SapDB query result
57 };
58 
59 #endif
const char * GetFieldName(Int_t field)
Get name of specified field.
Int_t fFieldCount
Definition: TSapDBResult.h:43
const char Option_t
Definition: RtypesCore.h:62
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TSapDBResult(SQLHSTMT fStmt, SDWORD rowCount=0)
#define ClassDef(name, id)
Definition: Rtypes.h:254
TString * fFieldNames
Definition: TSapDBResult.h:42
SQLHSTMT fResult
Definition: TSapDBResult.h:41
TSQLRow * Next()
Get next query result row.
Int_t GetFieldCount()
Get number of fields in result.
~TSapDBResult()
Cleanup SapDB query result.
void Close(Option_t *opt="")
Close query result.
Bool_t IsValid(Int_t field)
Check if result set is open and field index within range.