home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************/
- /* File: sdsstup.inl */
- /* Class: */
- /* IDSStatementUpdate */
- /* */
- /******************************************************************************/
-
- /***********************************************
-
- Licensed Materials - Property of IBM
-
- 5622-880 5801-AAR
-
- (c) Copyright IBM Corp 1991, 1996.
-
- ************************************************/
-
- //#include "sdsstup.hpp"
-
- /*-----------------------------------------------------------------+
- | Constructor |
- +-----------------------------------------------------------------*/
- inline IDSStatementUpdate::IDSStatementUpdate(const char* aStatement,
- DatastoreDB2* aDatastore )
- :IDSStatement(aStatement,aDatastore)
- {
-
- }
-
- inline IDSStatementUpdate::IDSStatementUpdate(const char* aStatement,
- DatastoreODBC* aDatastore )
- :IDSStatement(aStatement,aDatastore)
- {
-
- }
-
- /*-----------------------------------------------------------------+
- | Destructor |
- +-----------------------------------------------------------------*/
- inline IDSStatementUpdate::~IDSStatementUpdate()
- {
-
- }
-
- inline IDSStatementUpdate&
- IDSStatementUpdate::execute()
- {
- parameterBuffers.bindToStatement( iSQLStatement );
- iSQLStatement->executeDirect(iStatement);
- switch (iSQLStatement->rowCount()) {
- case 0:
- {
- 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);
- }
- case 1:
- break; // OK
- default:
- {
- //iSQLStatement->rollback();
- IString strError = ClsEnv::daxMsg(DAX_MSG_OBJECT_NOT_UNIQUE);
- IDADataObjectInvalid exc(strError,DAX_MSG_OBJECT_NOT_UNIQUE,IException::recoverable);
- ITHROW (exc);
- }
- }
- return *this;
- }