home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************/
- /* File: idsstre.inl */
- /* Class: */
- /* IDSStatementRetrieve */
- /* */
- /******************************************************************************/
- /******************************************************************************/
- /* */
- /* IBM(R) VisualAge(TM) C++ for OS/2(R), Version 3 */
- /* (C) Copyright IBM Corp. 1991, 1996. */
- /* - Licensed Material - Program-Property of IBM - All Rights Reserved. */
- /* US Government Users Restricted Rights - Use, duplication or disclosure */
- /* restricted by GSA ADP Schedule Contract with IBM Corp. */
- /* */
- /******************************************************************************/
-
- //#include "idsstre.hpp"
-
- /*-----------------------------------------------------------------+
- | Constructor |
- +-----------------------------------------------------------------*/
- inline IDSStatementRetrieve::IDSStatementRetrieve(const char* aStatement,
- IDatastoreDB2* aDatastore )
- :IDSStatement(aStatement,aDatastore)
- {
-
- }
-
- inline IDSStatementRetrieve::IDSStatementRetrieve(const char* aStatement,
- IDatastoreODBC* aDatastore )
- :IDSStatement(aStatement,aDatastore)
- {
-
- }
-
- /*-----------------------------------------------------------------+
- | Destructor |
- +-----------------------------------------------------------------*/
- inline IDSStatementRetrieve::~IDSStatementRetrieve()
- {
-
- }
-
- inline IDSStatementRetrieve&
- IDSStatementRetrieve::execute()
- {
- parameterBuffers.bindToStatement(iSQLStatement);
- iSQLStatement->executeDirect(iStatement);
- columnBuffers.bindToStatement(iSQLStatement);
- if (iSQLStatement->fetch()) {
- IString strError = ClsEnv::daxMsg(DAX_MSG_OBJECT_NOT_FOUND_OR_NOT_INSERTED);
- IDADataObjectNotFound exc(strError,DAX_MSG_OBJECT_NOT_FOUND_OR_NOT_INSERTED,IException::recoverable);
- ITHROW (exc);
- }
- // *** disable check for non-unique object ***
- //if (iSQLStatement->moreResults()) {
- // IString strError = ClsEnv::daxMsg(DAX_MSG_OBJECT_NOT_UNIQUE);
- // IDADataObjectInvalid exc(strError,DAX_MSG_OBJECT_NOT_UNIQUE,IException::recoverable);
- // ITHROW (exc);
- //}
- return *this;
- }