home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / idsstre.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  2.9 KB  |  63 lines

  1. /******************************************************************************/
  2. /* File:   idsstre.inl                                                        */
  3. /* Class:                                                                     */
  4. /*         IDSStatementRetrieve                                               */
  5. /*                                                                            */
  6. /******************************************************************************/
  7. /******************************************************************************/
  8. /*                                                                            */
  9. /* IBM(R) VisualAge(TM) C++ for OS/2(R), Version 3                            */
  10. /* (C) Copyright IBM Corp. 1991, 1996.                                        */
  11. /*  - Licensed Material - Program-Property of IBM - All Rights Reserved.      */
  12. /* US Government Users Restricted Rights - Use, duplication or disclosure     */
  13. /* restricted by GSA ADP Schedule Contract with IBM Corp.                     */
  14. /*                                                                            */
  15. /******************************************************************************/
  16.  
  17. //#include "idsstre.hpp"
  18.  
  19. /*-----------------------------------------------------------------+
  20. |  Constructor                                                     |
  21. +-----------------------------------------------------------------*/
  22. inline IDSStatementRetrieve::IDSStatementRetrieve(const char* aStatement,
  23.                            IDatastoreDB2* aDatastore )
  24.           :IDSStatement(aStatement,aDatastore)
  25. {
  26.  
  27. }
  28.  
  29. inline IDSStatementRetrieve::IDSStatementRetrieve(const char* aStatement,
  30.                            IDatastoreODBC* aDatastore )
  31.           :IDSStatement(aStatement,aDatastore)
  32. {
  33.  
  34. }
  35.  
  36. /*-----------------------------------------------------------------+
  37. |  Destructor                                                      |
  38. +-----------------------------------------------------------------*/
  39. inline IDSStatementRetrieve::~IDSStatementRetrieve()
  40. {
  41.  
  42. }
  43.  
  44. inline IDSStatementRetrieve&
  45. IDSStatementRetrieve::execute()
  46. {
  47.     parameterBuffers.bindToStatement(iSQLStatement);
  48.     iSQLStatement->executeDirect(iStatement);
  49.     columnBuffers.bindToStatement(iSQLStatement);
  50.     if (iSQLStatement->fetch()) {
  51.         IString strError = ClsEnv::daxMsg(DAX_MSG_OBJECT_NOT_FOUND_OR_NOT_INSERTED);
  52.         IDADataObjectNotFound exc(strError,DAX_MSG_OBJECT_NOT_FOUND_OR_NOT_INSERTED,IException::recoverable);
  53.         ITHROW (exc);
  54.     }
  55.     //  *** disable check for non-unique object ***
  56.     //if (iSQLStatement->moreResults()) {
  57.     //    IString strError = ClsEnv::daxMsg(DAX_MSG_OBJECT_NOT_UNIQUE);
  58.     //    IDADataObjectInvalid exc(strError,DAX_MSG_OBJECT_NOT_UNIQUE,IException::recoverable);
  59.     //    ITHROW (exc);
  60.     //}
  61.     return *this;
  62. }
  63.