Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

CTBodbcStatement.hxx

Go to the documentation of this file.
00001 #ifndef _CTBodbcStatement_HXX
00002 #define _CTBodbcStatement_HXX 1
00003 //
00004 // $Id: CTBodbcStatement.hxx,v 1.6 1999/04/23 09:43:07 mueller Exp $
00005 //
00006 /*----------------------------------------------------------------------------*/
00007 /* C Tool Box: Designed and implemented by:                                   */
00008 /*    Walter F.J. Mueller   Gesellschaft fuer Schwerionenforschung (GSI)      */
00009 /*                          Planckstrasse 1, D-64291 Darmstadt, Germany       */
00010 /*                  Email:  W.F.J.Mueller@gsi.de                              */
00011 /*                  WWW:    http://www-kp3.gsi.de/www/kp3/people/mueller.html */
00012 /*------------------------------------------+---------------------------------*/
00013 
00014 #include "CTBodbcTime.hxx"
00015 
00016 class CTBodbcStatement {
00017 
00018   public: 
00019 
00020     enum {                                  // format types for FetchToStream
00021       format_bsv = 0,                       
00022       format_bsvh,                          
00023       format_tsv,                           
00024       format_tsvh,                          
00025       format_csv,                           
00026       format_csvh,                          
00027       format_lvp,                           
00028       format_lvph                           
00029     };
00030 
00031                     CTBodbcStatement(CTBodbcConnect& dbc);
00032 
00033                     ~CTBodbcStatement();
00034 
00035     bool            Prepare(const char* c_stmt);
00036 
00037     bool            Execute();
00038     bool            Fetch();
00039     bool            Close();
00040     bool            UnbindParameter();
00041     bool            UnbindCol();
00042 
00043     bool            NumResultCols(int& i_ncol);
00044 
00045     bool            DescribeCol(int i_icol, char* c_colname,
00046                                 int i_size, SWORD& i_sqltype,
00047                                 int& i_precision, int& i_scale,
00048                                 bool& b_nullable);
00049 
00050     bool            FetchToStream(ostream& os,
00051                                   int i_format = format_bsv, int i_maxrow = 0);
00052 
00053     bool            GetData(int i_icol, SWORD i_ctype,
00054                             void* p_value, int i_size, bool& b_null);
00055 
00056     bool            GetData(int i_icol,
00057                             char* c_value, int i_size, bool& b_null);
00058     bool            GetData(int i_icol,
00059                             CTBint32& i_value, bool& b_null);
00060     bool            GetData(int i_icol,
00061                             float& f_value, bool& b_null);
00062     bool            GetData(int i_icol,
00063                             double& d_value, bool& b_null);
00064     bool            GetData(int i_icol,
00065                             CTBodbcTime& time, bool& b_null);
00066 
00067     bool            BindIParameter(int i_ipar, SWORD i_ctype, 
00068                                    SWORD i_sqltype, void* p_value);
00069 
00070     bool            BindIParameter(int i_ipar, SWORD i_sqltype,
00071                                    const char* c_pvalue);
00072     bool            BindIParameter(int i_ipar, SWORD i_sqltype,
00073                                    CTBint32& i_pvalue);
00074     bool            BindIParameter(int i_ipar,
00075                                    SWORD i_sqltype, float& f_pvalue);
00076     bool            BindIParameter(int i_ipar, SWORD i_sqltype,
00077                                    double& d_pvalue);
00078     bool            BindIParameter(int i_ipar, SWORD i_sqltype,
00079                                    CTBodbcTime& pvalue);
00080 
00081     bool            BindCol(int i_icol, SWORD i_ctype,
00082                             void* p_value, int i_size, CTBint32& pi_rsize);
00083 
00084     bool            BindCol(int i_icol, char* c_cvalue, int i_size, 
00085                             CTBint32& i_rsize);
00086     bool            BindCol(int i_icol, CTBint32& i_cvalue,
00087                             CTBint32& i_rsize);
00088     bool            BindCol( int i_icol, float& f_cvalue,
00089                              CTBint32& i_rsize);
00090     bool            BindCol(int i_icol, double& d_cvalue,
00091                             CTBint32& i_rsize);
00092     bool            BindCol(int i_icol,CTBodbcTime& cvalue,
00093                             CTBint32& i_rsize);
00094 
00095     void            PrintError(ostream& os = cout);
00096 
00097   private:
00098 
00099     bool            AllocIfNull();
00100 
00101   private:
00102 
00103     CTBodbcConnect&   m_dbc;                
00104     HSTMT           m_hstmt;                
00105 };
00106 
00107 #if !(defined(CTB__OutLine) || defined(CTBodbcStatement__OutLine))
00108 #include "CTBodbcStatement.icc"
00109 #endif
00110 
00111 #endif

Generated at Fri Oct 24 18:16:03 2003 for CTBodbc by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001