. */ require_once 'creole/common/StatementCommon.php'; require_once 'creole/Statement.php'; /** * Class that contains MSSQL functionality for Statements. * * @author Hans Lellelid * @version $Revision: 1.4 $ * @package creole.drivers.mssql */ class MSSQLStatement extends StatementCommon implements Statement { /** * Executes the SQL query in this PreparedStatement object and returns the resultset generated by the query. * * @param string $sql This method may optionally be called with the SQL statement. * @param int $fetchmode The mode to use when fetching the results (e.g. ResultSet::FETCHMODE_NUM, ResultSet::FETCHMODE_ASSOC). * @return object Creole::ResultSet * @throws SQLException If there is an error executing the specified query. */ public function executeQuery($sql, $fetchmode = null) { $this->updateCount = null; $this->resultSet = $this->conn->executeQuery($sql, $fetchmode); $this->resultSet->_setOffset($this->offset); $this->resultSet->_setLimit($this->limit); return $this->resultSet; } /** * Gets next result set (if this behavior is supported by driver). * Some drivers (e.g. MSSQL) support returning multiple result sets -- e.g. * from stored procedures. * * This function also closes any current restult set. * * Default behavior is for this function to return false. Driver-specific * implementations of this class can override this method if they actually * support multiple result sets. * * @return boolean True if there is another result set, otherwise false. */ public function getMoreResults() { if ($this->resultSet) $this->resultSet->close(); $this->resultSet = null; return false; } }