english/libraries/joomla/database/database/sqlsrv.php
/**
	 * Execute a query batch.
	 *
	 * @return      mixed  A database resource if successful, false if not.
	 *
	 * @since       11.1
	 * @deprecated  11.2
	 */
Execute a query batch.
@return      mixed  A database resource if successful, false if not.


Execute a query batch . @return mixed A database resource if successful false if not .
public function queryBatch($abortOnError=true, $transactionSafe = false)
	{
		JLog::add('JDatabase::queryBatch() is deprecated.', JLog::WARNING, 'deprecated');
		$sql = $this->replacePrefix((string) $this->sql);
		$this->errorNum = 0;
		$this->errorMsg = '';
		if ($transactionSafe) {
			$this->_sql = 'BEGIN TRANSACTION;'.$this->sql.'; COMMIT TRANSACTION;';
		}
		$queries = $this->splitSql($sql);
		$error = 0;
		foreach ($queries as $query)
		{
			$query = trim($query);
			if ($query != '') {
				$this->cursor = sqlsrv_query($this->connection, $query, null, array('scrollable' => SQLSRV_CURSOR_STATIC));
				if ($this->_debug) {
					$this->count++;
					$this->log[] = $query;
				}
				if (!$this->cursor) {
					$error = 1;
					$errors = sqlsrv_errors();
					$this->errorNum = $errors[0]['sqlstate'];
					$this->errorMsg = $errors[0]['message'];
					if ($abortOnError) {
						return $this->cursor;
					}
				}
			}
		}
		return $error ? false : true;
	}
public function queryBatch ( $ abortOnError = true , $ transactionSafe = false ) { JLog :: add ( 'JDatabase::queryBatch() is deprecated.' , JLog :: WARNING , 'deprecated' ) ; $ sql = $ this -> replacePrefix ( ( string ) $ this -> sql ) ; $ this -> errorNum = 0 ; $ this -> errorMsg = '' ; if ( $ transactionSafe ) { $ this -> _sql = 'BEGIN TRANSACTION;' . $ this -> sql . '; COMMIT TRANSACTION;' ; } $ queries = $ this -> splitSql ( $ sql ) ; $ error = 0 ; foreach ( $ queries as $ query ) { $ query = trim ( $ query ) ; if ( $ query != '' ) { $ this -> cursor = sqlsrv_query ( $ this -> connection , $ query , null , array ( 'scrollable' => SQLSRV_CURSOR_STATIC ) ) ; if ( $ this -> _debug ) { $ this -> count ++ ; $ this -> log [ ] = $ query ; } if ( ! $ this -> cursor ) { $ error = 1 ; $ errors = sqlsrv_errors ( ) ; $ this -> errorNum = $ errors [ 0 ] [ 'sqlstate' ] ; $ this -> errorMsg = $ errors [ 0 ] [ 'message' ] ; if ( $ abortOnError ) { return $ this -> cursor ; } } } } return $ error ? false : true ; }
Execute a query batch.
Execute a query batch .
// Deprecation warning. // If the batch is meant to be transaction safe then we need to wrap it in a transaction.