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>
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 ◆ EAllowLogAllow transaction log (general, to avoid using bools).
Enumerator eDisableLogDisables log.
eEnableLogEnables log.
Definition at line 248 of file sdbapi.hpp.
◆ EHowMuchWhether to consider just the current result set or all result sets, in MultiSet mode.
(In SingleSet mode, always consider all.)
Enumerator eThisResultSet eAllResultSetsDefinition 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 ) constGet 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.
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.
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_ImplQuery 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