fatalmind::oracle::SQLSelectRow< TM, SLMDC > Class Template Reference

#include <SQLSelectRow.hh>

Inherits fatalmind::oracle::CommandCommon< TM, SLMDC >< TM, SLMDC >, fatalmind::oracle::oracleBindOut, and fatalmind::SQLSelect.

Inherited by fatalmind::oracle::SQLSelect< TM, SLMDC >.

List of all members.


Detailed Description

template<class TM, template< class > class SLMDC>
class fatalmind::oracle::SQLSelectRow< TM, SLMDC >

Select a single row from an oracle database.

Public Types

typedef
fatalmind::oracle::ResourceType
< TM, SLMDC > 
pool_type
typedef VBC _datat
typedef gc_ptr< VBC > _ptrt
typedef std::vector
< _ptrt
_argst

Public Member Functions

 SQLSelectRow (const SQL::SQLStatement &SQL, SQL::SQLFetcher &=SQL::NopFetcher)
 SQLSelectRow (const ResourcePool< ResourceType< TM > > &p, const SQL::SQLStatement &SQL, SQL::SQLFetcher &=SQL::NopFetcher)
virtual void outputoperator (std::ostream &s) const
virtual void execute (oracleResource< TM > &hand)
virtual void execute (typename fatalmind::oracle::ResourceType< TM, SLMDC >::resource_t &rr)=0
 The execute method is the one which actually carries out the work.
virtual void bind (const unsigned int pos, const char &val, bool isnull=false)
 Binds an actual input value for an placeholder in the SQL statement.
virtual void bind (const unsigned int pos, const signed char &val, bool isnull=false)
virtual void bind (const unsigned int pos, const unsigned char &val, bool isnull=false)
virtual void bind (const unsigned int pos, const short int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const unsigned short int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const unsigned int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const long int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const unsigned long int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const float &val, bool isnull=false)
virtual void bind (const unsigned int pos, const double &val, bool isnull=false)
virtual void bind (const unsigned int pos, const long double &val, bool isnull=false)
virtual void bind (const unsigned int pos, const std::string &val, bool isnull=false)
virtual void clearParameters ()
virtual void bindoutputoperator (std::ostream &str) const
virtual void bindout (const unsigned int pos, char &val, bool &isnull=BindOutInterface::notnullconstant)
 Specify where the output data of an select statement are to be stored.
virtual void bindout (const unsigned int pos, signed char &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, unsigned char &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, short int &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, unsigned short int &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, int &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, unsigned int &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, long int &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, unsigned long int &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, float &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, double &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, long double &val, bool &isnull=BindOutInterface::notnullconstant)
virtual void bindout (const unsigned int pos, std::string &val, bool &isnull=BindOutInterface::notnullconstant)

Static Public Member Functions

static void bindoutputoperator (std::ostream &str, const _argst &)

Static Public Attributes

static bool notnullconstant

Protected Types

typedef SQL::Bind
< oracleType,
oracleTypeImpl > 
super_bind
typedef gc_ptr< VBC > _refT
typedef std::vector
< _refT
_outparamt

Protected Member Functions

virtual Clone * DoClone () const
void _execute (oracleResource< TM > &, StatementCache &)
void postSelectBuffer (oracleResource< TM > &, OCIStatementHandle &sth)
void preSelectBuffer (oracleResource< TM > &)
void preSelectBufferBind (oracleHandles &, OCIStatementHandle &sth)
StatementCache::handle_t prepare_buffer (oracleResource< TM > &hand, StatementCache &sthcache)
StatementCache::handle_t prepareForSelect (oracleResource< TM > &hand, StatementCache &sthcache)
virtual const
std::string & 
getCommandName () const
StatementCache::handle_t prepare (oracleResource< TM > &, StatementCache &, const oracleStatement &oraSQL)
void real_bind (oracleResource< TM > &, OCIStatementHandle &sth)
const std::string & getSQL () const
const
fatalmind::oracle::ResourceType
< TM, SLMDC >
::factory_t & 
getFactory (const ResourcePool< fatalmind::oracle::ResourceType< TM, SLMDC > > &p) const
bool topLevel () const
void topLevel (bool tl)
void _done ()
void _start ()
void real_bindout (oracleHandles &, const OCIStatementHandle &, const SQL::SQLStatement &)
bool fetch (oracleHandles &, const OCIStatementHandle &, const SQL::SQLStatement &)
bool _fetch (oracleHandles &, const OCIStatementHandle &, const SQL::SQLStatement &)
void finish (oracleHandles &, const OCIStatementHandle &, const SQL::SQLStatement &)
void validateBindOut (const SQL::SQLStatement &SQL) const
VBC & getOutParam (const unsigned int pos)
void setIterators ()

Protected Attributes

oracleStatement _SQL
 this is a copy of the original SQL statement.
_argst _args
gc_ptr
< SelectListMetaData > 
_slmd
gc_ptr
< SelectListBuffer > 
_slb
_outparamt _outparam
_outparamt::const_iterator _begin
_outparamt::const_iterator _end
SQL::SQLFetcherfetcher

Static Protected Attributes

static const std::string _SQLSelectRowName
static const std::string _CommandCommonName

Friends

class Transaction< TM, SLMDC >
class ResourcePool< PT >
class SelectListBuffer
class internal::registerFinish

Member Function Documentation

virtual void fatalmind::Command< fatalmind::oracle::ResourceType< TM, SLMDC > >::execute ( typename fatalmind::oracle::ResourceType< TM, SLMDC > ::resource_t &  rr  )  [pure virtual, inherited]

The execute method is the one which actually carries out the work.

This method gets called by ResourcePool with a (valid) plain resource which was obtained from the pool.

On normal execution (no exception) the resource will be free()ed, on abnormal execution (exception) the resource will be failed. If you need to throw an functional exception which should not cause failing of the resource, derive this exception from NoFailoverException.

template<class VBC, template< class > class CT>
virtual void fatalmind::SQL::Bind< VBC, CT >::bind ( const unsigned int  pos,
const char &  val,
bool  isnull = false 
) [inline, virtual, inherited]

Binds an actual input value for an placeholder in the SQL statement.

All binding is done by value! This means the passed data are copied to internal storage. Changing your original copy of your data after passing it to bind() is therefore safe.

Parameters:
pos The position indicator. The number of placeholder (?) in the SQL string. Counted from the left starting at 0.
val the actual value.
nul NULL inidcator, if set to yes the actual value to be bound will be NULL. Please note that you still need to provide a valid value!

Implements fatalmind::SQL::BindInterface.

template<class VBC, template< class > class CT>
virtual void fatalmind::SQL::BindOut< VBC, CT >::bindout ( const unsigned int  pos,
char &  val,
bool &  isnull = BindOutInterface::notnullconstant 
) [inline, virtual, inherited]

Specify where the output data of an select statement are to be stored.

You need to specify an place where the columns for an select statement are to be stored. After each fetch those variables will be propagated with the actual values received from the select statement. You can also specify a bool which will be used as indicator if the fatched column is NULL. If you omit this third, optional parameter an Exception will be thrown in case a fetched column is NULL.

Parameters:
pos The column number to be bound. Numbering starts with the leftmost column at 0.
val The variable which should contain the value of this column after the fetch. Each time a row is retrieved the according column value value will be available in that variable. The content of the variable will not be changed in case the column is NULL or the execution failed because of an exception. Exclusive access is expected, so there are no synchronization effords taken by the select commands. The variable must be availalbe throughout the whole time of execution.
isnull The optional third argument specifies a bool variable which will be set to true if the fetched column is NULL or to false otherwise. You must supply this indicator variable if you might retrieve NULL for this column. Not supplying an indicator varaible will cause an
Indicator variable required but not supplied.
exception. Well, so if you are sure your result will never be NULL, it's save to not provide the third arguement. In case you were wrong, you will receive an exception.

Implements fatalmind::SQL::BindOutInterface.


The documentation for this class was generated from the following files:
Generated on Mon Nov 9 16:21:24 2009 for ResourcePool by  doxygen 1.5.3