Ejemplo n.º 1
0
 /**
  * @return $this
  */
 public function nextRowset()
 {
     if (!parent::nextRowset()) {
         throw new Exception\RuntimeException('Rowset is not available.');
     }
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * 
  * @throws PDOException
  */
 public function _query()
 {
     if ($this->_rowset === false) {
         if (self::$_stmt) {
             while (self::$_stmt->nextRowset()) {
                 //如果已经在结果缓存中,则搜寻结果集
                 $query = array_shift(self::$_fetchingQueue);
                 $query->_rowset = $query->_fetchAll();
                 if ($query === $this) {
                     return;
                 }
             }
             self::$_stmt = null;
         }
         //将当前的语句插到第一个,然后把所有语句一口气打包发送给mysql
         $keys = array_keys(self::$_waitingQueue, $this);
         if (count($keys)) {
             unset(self::$_waitingQueue[$keys[0]]);
         }
         $sql = $this->_select->assemble();
         if (count(self::$_waitingQueue)) {
             $sql .= ";\n" . implode(";\n", self::$_waitingQueue);
         }
         implode(";\n", self::$_waitingQueue);
         self::$_stmt = $this->_select->getAdapter()->query($sql);
         $this->_rowset = $this->_fetchAll();
         self::$_fetchingQueue = self::$_waitingQueue;
         self::$_waitingQueue = array();
     }
 }
Ejemplo n.º 3
0
 /**
  * Advances the reader to the next rowset
  * Not supported by mssql
  *
  * @return boolean
  */
 public function nextRowset()
 {
     if (false !== ($result = $this->_statement->nextRowset())) {
         $this->_index = null;
     }
     return $result;
 }
Ejemplo n.º 4
0
	/**
	 * Move to the next row
	 */
	public function nextRowset()
	{
		if ($this->_statement !== null) {
			$this->_statement->nextRowset();
		}
		$this->_index++;
	}
Ejemplo n.º 5
0
 /**
  * Retrieves the next rowset (result set) for a SQL statement that has
  * multiple result sets.  An example is a stored procedure that returns
  * the results of multiple queries.
  *
  * @return bool
  * @throws Zend_Db_Statement_Exception
  */
 public function nextRowset()
 {
     try {
         return $this->_stmt->nextRowset();
     } catch (PDOException $e) {
         require_once 'Zend/Db/Statement/Exception.php';
         throw new Zend_Db_Statement_Exception($e->getMessage());
     }
 }
Ejemplo n.º 6
0
 public function getMoreResults()
 {
     $this->checkClosed();
     $this->stmt->nextRowset();
     $this->resultSet = null;
     $this->updateCount = -1;
     if ($this->stmt->columnCount() == 0) {
         $this->updateCount = $this->stmt->rowCount();
         return false;
     }
     return true;
 }
Ejemplo n.º 7
0
 /**
  * 在一个多行集语句句柄中推进到下一个行集
  * @return bool
  */
 public function nextRowset()
 {
     return $this->_PDOStatement->nextRowset();
 }
Ejemplo n.º 8
0
 public static function next_result(\PDOStatement $stmt)
 {
     return $stmt->nextRowset();
 }
Ejemplo n.º 9
0
 /**
  * @return bool
  * @throws \Compeek\PDOWrapper\NotConnectedException
  */
 public function nextRowset()
 {
     $this->requireConnection();
     return $this->pdoStatement->nextRowset();
 }
Ejemplo n.º 10
0
 public function nextRowset()
 {
     $this->_pdoStatement->nextRowset();
 }
Ejemplo n.º 11
0
 private function ManageExecutionResult(\PDOStatement $dbStatement)
 {
     $result = array();
     $isValid = true;
     foreach ($this->dbConfigList() as $dbConfig) {
         if (!$isValid) {
             break;
         } elseif ($this->CheckType($dbConfig->type(), DbExecutionType::SELECT)) {
             $dbStatement->setFetchMode(\PDO::FETCH_CLASS | \PDO::FETCH_PROPS_LATE, $dbConfig->daoClassName());
             $list = $dbStatement->fetchAll();
             $result = count($list) > 0 ? $list : array();
         } elseif ($this->CheckType($dbConfig->type(), DbExecutionType::UPDATE)) {
             $result = true;
         } elseif ($this->CheckType($dbConfig->type(), DbExecutionType::INSERT)) {
             $result = $this->dao->lastInsertId();
         } elseif ($this->CheckType($dbConfig->type(), DbExecutionType::SHOWTABLES)) {
             $result = $dbStatement->fetchAll(\PDO::FETCH_NUM);
         } elseif ($this->CheckType($dbConfig->type(), DbExecutionType::COLUMNNAMES)) {
             $result = $dbStatement->fetchAll(\PDO::FETCH_COLUMN);
         } elseif ($this->CheckType($dbConfig->type(), DbExecutionType::COLUMNMETAS)) {
             $result = $dbStatement->fetch(\PDO::FETCH_ASSOC);
         } elseif ($this->CheckType($dbConfig->type(), DbExecutionType::MULTIROWSET)) {
             //TODO: to implement.
             $isValid = $dbStatement->nextRowset();
         }
     }
     $dbStatement->closeCursor();
     return $result;
 }
Ejemplo n.º 12
0
 /**
  * @return void 
  */
 public function nextRowset()
 {
     $this->execute();
     return parent::nextRowset();
 }
 /**
  * @return bool
  */
 public function nextRowset()
 {
     $archLog = array('method' => 'PDOStatement::nextRowset', 'input' => array(), 'output' => $this->PDOStatement->nextRowset(), 'pointer' => $this->assignPointerString());
     return self::setLogReturnOutput($archLog);
 }