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

  1. /******************************************************************************/
  2. /* File:   sdsstre.inl                                                        */
  3. /* Class:                                                                     */
  4. /*         IDSStatementRetrieve                                               */
  5. /*                                                                            */
  6. /******************************************************************************/
  7.  
  8. /***********************************************
  9.  
  10.     Licensed Materials - Property of IBM
  11.  
  12.     5622-880   5801-AAR
  13.  
  14.     (c) Copyright IBM Corp 1991, 1996.
  15.  
  16. ************************************************/
  17.  
  18. //#include "sdsstre.hpp"
  19.  
  20. /*-----------------------------------------------------------------+
  21. |  Constructor                                                     |
  22. +-----------------------------------------------------------------*/
  23. inline IDSStatementRetrieve::IDSStatementRetrieve(const char* aStatement,
  24.                            DatastoreDB2* aDatastore )
  25.           :IDSStatement(aStatement,aDatastore)
  26. {
  27.  
  28. }
  29.  
  30. inline IDSStatementRetrieve::IDSStatementRetrieve(const char* aStatement,
  31.                            DatastoreODBC* aDatastore )
  32.           :IDSStatement(aStatement,aDatastore)
  33. {
  34.  
  35. }
  36.  
  37. /*-----------------------------------------------------------------+
  38. |  Destructor                                                      |
  39. +-----------------------------------------------------------------*/
  40. inline IDSStatementRetrieve::~IDSStatementRetrieve()
  41. {
  42.  
  43. }
  44.  
  45. inline IDSStatementRetrieve&
  46. IDSStatementRetrieve::execute()
  47. {
  48.     parameterBuffers.bindToStatement(iSQLStatement);
  49.     iSQLStatement->executeDirect(iStatement);
  50.     columnBuffers.bindToStatement(iSQLStatement);
  51.     if (iSQLStatement->fetch()) {
  52.         IString strError = ClsEnv::daxMsg(DAX_MSG_OBJECT_NOT_FOUND_OR_NOT_INSERTED);
  53.         IDADataObjectNotFound exc(strError,DAX_MSG_OBJECT_NOT_FOUND_OR_NOT_INSERTED,IException::recoverable);
  54.         ITHROW (exc);
  55.     }
  56.     //  *** disable check for non-unique object ***
  57.     //if (iSQLStatement->moreResults()) {
  58.     //    IString strError = ClsEnv::daxMsg(DAX_MSG_OBJECT_NOT_UNIQUE);
  59.     //    IDADataObjectInvalid exc(strError,DAX_MSG_OBJECT_NOT_UNIQUE,IException::recoverable);
  60.     //    ITHROW (exc);
  61.     //}
  62.     return *this;
  63. }
  64.