A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/classCQuery.html below:

NCBI C++ ToolKit: CQuery Class Reference

Search Toolkit Book for CQuery

Object used to execute queries and stored procedures on the database server and retrieve result sets. More...

#include <dbapi/simple/sdbapi.hpp>

class   CField   Class representing value in result set or output parameter of stored procedure. More...
  class   CRow   A full row of result data. More...
  class   CRowIterator   Iterator class doing main navigation through result sets. More...
    CQuery (void)   Empty constructor of query object. More...
    ~CQuery (void)     CQuery (const CQuery &q)   Copying of query object from other one. More...
  CQueryoperator= (const CQuery &q)   CQuerySetParameter (CTempString name, const string &value, ESDB_Type type=eSDB_String, ESP_ParamType param_type=eSP_In)   Assign string value to the parameter. More...
  CQuerySetParameter (CTempString name, const char *value, ESDB_Type type=eSDB_String, ESP_ParamType param_type=eSP_In)   Assign string value to the parameter. More...
  CQuerySetParameter (CTempString name, Int8 value, ESDB_Type type=eSDB_Int8, ESP_ParamType param_type=eSP_In)   Assign 8-byte integer value to the parameter. More...
  CQuerySetParameter (CTempString name, Int4 value, ESDB_Type type=eSDB_Int4, ESP_ParamType param_type=eSP_In)   Assign 4-byte integer value to the parameter. More...
  CQuerySetParameter (CTempString name, long value, ESDB_Type type=eSDB_Int4, ESP_ParamType param_type=eSP_In)   CQuerySetParameter (CTempString name, short value, ESDB_Type type=eSDB_Short, ESP_ParamType param_type=eSP_In)   Assign short integer value to the parameter. More...
  CQuerySetParameter (CTempString name, unsigned char value, ESDB_Type type=eSDB_Byte, ESP_ParamType param_type=eSP_In)   Assign byte value to the parameter. More...
  CQuerySetParameter (CTempString name, float value, ESDB_Type type=eSDB_Float, ESP_ParamType param_type=eSP_In)   Assign float value to the parameter. More...
  CQuerySetParameter (CTempString name, double value, ESDB_Type type=eSDB_Double, ESP_ParamType param_type=eSP_In)   Assign double value to the parameter. More...
  CQuerySetParameter (CTempString name, const CTime &value, ESDB_Type type=eSDB_DateTime, ESP_ParamType param_type=eSP_In)   Assign CTime value to the parameter. More...
  CQuerySetParameter (CTempString name, bool value, ESDB_Type type=eSDB_Bit, ESP_ParamType param_type=eSP_In)   Assign bool value to the parameter. More...
  CQuerySetNullParameter (CTempString name, ESDB_Type type, ESP_ParamType param_type=eSP_In)   Assign null value to the parameter. More...
  CQuerySetOutputParameter (CTempString name, ESDB_Type type)   Declare an output-only parameter. More...
  const CFieldGetParameter (CTempString name)   Get value of the parameter. More...
  CQueryClearParameter (CTempString name)   Remove parameter with given name from parameter list. More...
  CQueryClearParameters (void)   Remove all parameters from parameter list. More...
  CQuerySetSql (CTempString sql)   Set current sql statement. More...
  CQueryExecute (const CTimeout &timeout=CTimeout(CTimeout::eDefault))   Explicitly execute sql statement. More...
  CQueryExecuteSP (CTempString sp, const CTimeout &timeout=CTimeout(CTimeout::eDefault))   Execute stored procedure with given name. More...
  void  Cancel (void)   Cancel the current statement or procedure call. More...
  int  GetRowCount (void) const   Get number of rows read after statement execution. More...
  int  GetStatus (void) const   Get return status of stored procedure. More...
  const list< string > &  GetPrintOutput (void) const   Get any PRINT output from the latest procedure call (or statement). More...
  bool  HasMoreResultSets (void)   Check if any more result sets are available for reading. More...
  void  PurgeResults (void)   Purge all remaining result sets; fill in all remaining parameter results. More...
  void  RequireRowCount (unsigned int n)   Indicate precisely how many rows the active query should return. More...
  void  RequireRowCount (unsigned int min_rows, unsigned int max_rows)   Indicate the minimum and maximum number of rows the active query should return. More...
  void  VerifyDone (EHowMuch how_much=eThisResultSet)   Ensure that no unread rows or parameter results remain, and that the total number of rows satisfies any constraints specified by RequireRowCount. More...
  unsigned int  GetTotalColumns (void) const   Get total number of columns in the current result set. More...
  string  GetColumnName (unsigned int col) const   Get name of the column with given number in the current result set. More...
  ESDB_Type  GetColumnType (unsigned int col) const   Get type of the column with given number in the current result set All columns are numbered starting with 1. More...
  unsigned int  GetResultSetNo (void) const   Get number of currently active result set. More...
  unsigned int  GetRowNo (EHowMuch how_much=eAllResultSets) const   Get row number currently active. More...
  CQuerySingleSet (void)   Convert this query to work like only one result set was returned effectively merging all result sets together. More...
  CQueryMultiSet (void)   Convert this query to not merge different result sets, i.e. More...
  CRowIterator  begin (void) const   Start iterating through next result set. More...
  CRowIterator  end (void) const   Get iterator pointing to the end of the current result set or to the end of all result sets (depending on the setting changed with SingleSet() and MultiSet()). More...
  CRow  GetTheOnlyRow (void)   Provides the only row for the executed query. More...
 

Object used to execute queries and stored procedures on the database server and retrieve result sets.

Definition at line 231 of file sdbapi.hpp.

◆ const_iterator ◆ iterator ◆ EAllowLog

Allow transaction log (general, to avoid using bools).

Enumerator eDisableLog 

Disables log.

eEnableLog 

Enables log.

Definition at line 248 of file sdbapi.hpp.

◆ EHowMuch

Whether to consider just the current result set or all result sets, in MultiSet mode.

(In SingleSet mode, always consider all.)

Enumerator eThisResultSet  eAllResultSets 

Definition at line 662 of file sdbapi.hpp.

◆ CQuery() [1/3]

Empty constructor of query object.

Object created this way cannot be used for anything except assigning from the other query object.

Definition at line 3910 of file sdbapi.cpp.

◆ ~CQuery() ◆ CQuery() [2/3]

Copying of query object from other one.

The copy of query object behaves with the same internal result set as the original object. So that if you increment iterator created from one object it will move to the next row in another query object too.

Definition at line 3918 of file sdbapi.cpp.

◆ CQuery() [3/3] ◆ begin() ◆ Cancel() void CQuery::Cancel ( void  )

Cancel the current statement or procedure call.

May be called asynchronously to force a "timeout" within one second.

Definition at line 4083 of file sdbapi.cpp.

References CQueryImpl::Cancel(), and m_Impl.

◆ ClearParameter() ◆ ClearParameters() CQuery & CQuery::ClearParameters ( void  ) ◆ end() ◆ Execute()

Explicitly execute sql statement.

All result sets left from previous statement or stored procedure execution are purged. The query reverts to SingleSet mode, with no row count requirements.

Definition at line 4069 of file sdbapi.cpp.

References CQueryImpl::Execute(), and m_Impl.

◆ ExecuteSP()

Execute stored procedure with given name.

All result sets left from previous statement or stored procedure execution are purged. The query reverts to SingleSet mode, with no row count requirements.

Definition at line 4076 of file sdbapi.cpp.

References CQueryImpl::ExecuteSP(), and m_Impl.

◆ GetColumnName() string CQuery::GetColumnName ( unsigned int  col ) const ◆ GetColumnType() ◆ GetParameter()

Get value of the parameter.

For eSP_In parameter value set to it will always be returned. For eSP_InOut parameter value set to it will be returned before stored procedure execution and value returned from procedure after executing it and reading its row results (or confirming that it produced none). Throw an exception if no such parameter exists, or if it's an output parameter but not yet available because the caller hasn't finished processing results.

Definition at line 4042 of file sdbapi.cpp.

References CQueryImpl::GetParameter(), and m_Impl.

◆ GetPrintOutput() const list< string > & CQuery::GetPrintOutput ( void  ) const

Get any PRINT output from the latest procedure call (or statement).

This output may be incomplete until the caller has explicitly read or purged all result sets.

Note
Many actions can invalidate this output, even working with other CQuery objects associated with the same CDatabase object or a normal (non-clone) copy thereof.

Definition at line 4158 of file sdbapi.cpp.

References CQueryImpl::GetPrintOutput(), and m_Impl.

◆ GetResultSetNo() unsigned int CQuery::GetResultSetNo ( void  ) const ◆ GetRowCount() int CQuery::GetRowCount ( void  ) const ◆ GetRowNo()

Get row number currently active.

Row numbers are assigned consecutively to each row in all result sets returned starting with 1. With eAllResultSets (default) or in MultiSet mode, row number is not reset after passing result set boundary.

Definition at line 4140 of file sdbapi.cpp.

References CQueryImpl::GetRowNo(), and m_Impl.

◆ GetStatus() int CQuery::GetStatus ( void  ) const ◆ GetTheOnlyRow() ◆ GetTotalColumns() unsigned int CQuery::GetTotalColumns ( void  ) const ◆ HasMoreResultSets() bool CQuery::HasMoreResultSets ( void  ) ◆ MultiSet() CQuery & CQuery::MultiSet ( void  )

Convert this query to not merge different result sets, i.e.

iterator will be equal to end() at the end of each result set and to switch to the next one you'll have to call begin() again. Method impacts not only this CQuery object and all iterators created from it but all copies of this CQuery object too.

Definition at line 4096 of file sdbapi.cpp.

References m_Impl, and CQueryImpl::SetIgnoreBounds().

◆ operator=() ◆ PurgeResults() void CQuery::PurgeResults ( void  ) ◆ RequireRowCount() [1/2] void CQuery::RequireRowCount ( unsigned int  min_rows, unsigned int  max_rows  )

Indicate the minimum and maximum number of rows the active query should return.

In MultiSet mode, the requirement applies to individual result sets. (Callers may specify the requirement for each set as it comes up, or let it carry over unchanged.) Any call to this method must follow Execute or ExecuteSP, which reset any such requirements.

Parameters
min_rows Minimum valid row count. max_rows Maximum valid row count. (kMax_Auto for no limit.)

Definition at line 4182 of file sdbapi.cpp.

References m_Impl, and CQueryImpl::RequireRowCount().

◆ RequireRowCount() [2/2] void CQuery::RequireRowCount ( unsigned int  n )

Indicate precisely how many rows the active query should return.

In MultiSet mode, the requirement applies to individual result sets. (Callers may specify the requirement for each set as it comes up, or let it carry over unchanged.) Any call to this method must follow Execute or ExecuteSP, which reset any such requirements.

Definition at line 4176 of file sdbapi.cpp.

References m_Impl, n, and CQueryImpl::RequireRowCount().

◆ SetNullParameter() ◆ SetOutputParameter()

Declare an output-only parameter.

Equivalent for now to calling SetNullParameter with a param_type value of eSP_InOut because MSSQL and Sybase (and hence FreeTDS) don't support true output-only parameters. However, if SDBAPI ever gains support for database engines with this feature, this method will arrange to make use of it as appropriate.

Definition at line 1450 of file sdbapi.hpp.

References eSP_InOut, and SetNullParameter().

◆ SetParameter() [1/11] ◆ SetParameter() [2/11] ◆ SetParameter() [3/11] ◆ SetParameter() [4/11] ◆ SetParameter() [5/11] ◆ SetParameter() [6/11] ◆ SetParameter() [7/11] ◆ SetParameter() [8/11] ◆ SetParameter() [9/11] ◆ SetParameter() [10/11] ◆ SetParameter() [11/11] ◆ SetSql() ◆ SingleSet() CQuery & CQuery::SingleSet ( void  )

Convert this query to work like only one result set was returned effectively merging all result sets together.

If some result sets were already read then all the remaining result sets will be merged. Method impacts not only this CQuery object and all iterators created from it but all copies of this CQuery object too. Result sets only from recently executed statement are affected. After re-execution of a statement default behavior is used - to not merge different result sets.

Definition at line 4089 of file sdbapi.cpp.

References m_Impl, and CQueryImpl::SetIgnoreBounds().

◆ VerifyDone()

Ensure that no unread rows or parameter results remain, and that the total number of rows satisfies any constraints specified by RequireRowCount.

Throw an exception (after purging any unread rows) if not.

Definition at line 4188 of file sdbapi.cpp.

References m_Impl, and CQueryImpl::VerifyDone().

Referenced by GetTheOnlyRow().

◆ CDatabase ◆ DBAPI_MakeTrans ◆ m_Impl

Query implementation object.

Definition at line 758 of file sdbapi.hpp.

Referenced by CQuery::CField::AsBool(), CQuery::CField::AsByte(), CQuery::CField::AsDateTime(), CQuery::CField::AsDouble(), CQuery::CField::AsFloat(), CQuery::CField::AsInt4(), CQuery::CField::AsInt8(), CQuery::CField::AsIStream(), CQuery::CField::AsShort(), CQuery::CField::AsString(), CQuery::CField::AsVector(), begin(), Cancel(), CQuery::CField::CField(), ClearParameter(), ClearParameters(), CQuery(), end(), Execute(), ExecuteSP(), CQuery::CField::GetBookmark(), GetColumnName(), GetColumnType(), CQuery::CField::GetOStream(), GetParameter(), GetPrintOutput(), GetResultSetNo(), GetRowCount(), GetRowNo(), GetStatus(), GetTheOnlyRow(), GetTotalColumns(), HasMoreResultSets(), CQuery::CField::IsNull(), MultiSet(), operator=(), PurgeResults(), RequireRowCount(), SetNullParameter(), SetParameter(), SetSql(), SingleSet(), VerifyDone(), and CQuery::CField::x_Detach().

The documentation for this class was generated from the following files:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4