00001 // @(#)root/sapdb:$Id: TSapDBResult.h 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: Mark Hemberger & Fons Rademakers 03/08/2001 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TSapDBResult 00013 #define ROOT_TSapDBResult 00014 00015 #ifndef ROOT_TSQLResult 00016 #include "TSQLResult.h" 00017 #endif 00018 00019 #if !defined(__CINT__) 00020 #include <sys/time.h> 00021 #include <WINDOWS.H> 00022 #ifdef min 00023 #undef min 00024 #endif 00025 #ifdef max 00026 #undef max 00027 #endif 00028 #include <sql.h> 00029 #include <sqlext.h> 00030 #else 00031 typedef long int SDWORD; 00032 typedef long SQLHSTMT; 00033 #endif 00034 00035 class TString; 00036 00037 00038 class TSapDBResult : public TSQLResult { 00039 00040 private: 00041 SQLHSTMT fResult; // query result (rows) 00042 TString *fFieldNames; // names of fields 00043 Int_t fFieldCount; // number of fields 00044 00045 Bool_t IsValid(Int_t field); 00046 00047 public: 00048 TSapDBResult(SQLHSTMT fStmt, SDWORD rowCount = 0); 00049 ~TSapDBResult(); 00050 00051 void Close(Option_t *opt=""); 00052 Int_t GetFieldCount(); 00053 const char *GetFieldName(Int_t field); 00054 TSQLRow *Next(); 00055 00056 ClassDef(TSapDBResult,0) // SapDB query result 00057 }; 00058 00059 #endif