Example #1
0
 public function _PrepareAndExecute(ISqlCommand &$sqlCommand, $prepareType)
 {
     $cmd = new Mdb2CommandAdapter($sqlCommand);
     $stmt =& $this->_db->prepare($cmd->GetQuery(), true, $prepareType);
     if (MDB2::isError($stmt)) {
         throw new Exception('Error preparing MDB2 command. Query=%s. Error=%s', $sqlCommand->__toString(), $stmt->getMessage());
     }
     $result =& $stmt->execute($cmd->GetValues());
     if (MDB2::isError($result)) {
         throw new Exception('Error executing MDB2 command. Query=%s. Error=%s', $sqlCommand->__toString(), $stmt->getMessage());
     }
     return new Mdb2Reader($result);
 }
Example #2
0
 public function GetQuery()
 {
     return $this->baseCommand->GetQuery() . sprintf(" LIMIT %s OFFSET %s", $this->limit, $this->offset);
 }