Query to use to get the number of rows affected by an update or delete query.
Issue a separate query to get the rows modified. ADO appears to use pass by reference with an integer variable, which is obviously not supported directly in ruby, and I'm not aware of a workaround.
# File lib/sequel/adapters/ado/mssql.rb, line 18 def execute_dui(sql, opts=OPTS) return super unless @opts[:provider] synchronize(opts[:server]) do |conn| begin log_yield(sql){conn.Execute(sql)} res = log_yield(ROWS_AFFECTED){conn.Execute(ROWS_AFFECTED)} res.getRows.transpose.each{|r| return r.shift} rescue ::WIN32OLERuntimeError => e raise_error(e) end end end
The ADO adapter's default provider doesn't support transactions, since it creates a new native connection for each query. So Sequel only attempts to use transactions if an explicit :provider is given.
# File lib/sequel/adapters/ado/mssql.rb, line 36 def begin_transaction(conn, opts=OPTS) super if @opts[:provider] end
# File lib/sequel/adapters/ado/mssql.rb, line 40 def commit_transaction(conn, opts=OPTS) super if @opts[:provider] end
# File lib/sequel/adapters/ado/mssql.rb, line 44 def rollback_transaction(conn, opts=OPTS) super if @opts[:provider] end