Logo ROOT   6.14/05
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 #include "TSQLResult.h"
16 
17 #if !defined(__CINT__)
18 #include <sys/time.h>
19 #include <WINDOWS.H>
20 #ifdef min
21 #undef min
22 #endif
23 #ifdef max
24 #undef max
25 #endif
26 #include <sql.h>
27 #include <sqlext.h>
28 #else
29 typedef long int SDWORD;
30 typedef long SQLHSTMT;
31 #endif
32 
33 class TString;
34 
35 
36 class TSapDBResult : public TSQLResult {
37 
38 private:
39  SQLHSTMT fResult; // query result (rows)
40  TString *fFieldNames; // names of fields
41  Int_t fFieldCount; // number of fields
42 
43  Bool_t IsValid(Int_t field);
44 
45 public:
46  TSapDBResult(SQLHSTMT fStmt, SDWORD rowCount = 0);
47  ~TSapDBResult();
48 
49  void Close(Option_t *opt="");
51  const char *GetFieldName(Int_t field);
52  TSQLRow *Next();
53 
54  ClassDef(TSapDBResult,0) // SapDB query result
55 };
56 
57 #endif
const char * GetFieldName(Int_t field)
Get name of specified field.
Int_t fFieldCount
Definition: TSapDBResult.h:41
const char Option_t
Definition: RtypesCore.h:62
Basic string class.
Definition: TString.h:131
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TSapDBResult(SQLHSTMT fStmt, SDWORD rowCount=0)
SapDB query result.
#define ClassDef(name, id)
Definition: Rtypes.h:320
TString * fFieldNames
Definition: TSapDBResult.h:40
SQLHSTMT fResult
Definition: TSapDBResult.h:39
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.