Class/Module Index [+]

Quicksearch

Sequel::ADO::MSSQL::DatabaseMethods

Constants

ROWS_AFFECTED

Query to use to get the number of rows affected by an update or delete query.

Public Instance Methods

execute_ddl(sql, opts={}) click to toggle source

Just execute so it doesn't attempt to return the number of rows modified.

# File lib/sequel/adapters/ado/mssql.rb, line 15
def execute_ddl(sql, opts={})
  execute(sql, opts)
end
Also aliased as: execute_insert
execute_dui(sql, opts={}) click to toggle source

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 23
def execute_dui(sql, 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
execute_insert(sql, opts={}) click to toggle source
Alias for: execute_ddl

[Validate]

Generated with the Darkfish Rdoc Generator 2.