Class/Module Index [+]

Quicksearch

Sequel::ODBC::MSSQL::DatabaseMethods

Constants

LAST_INSERT_ID_SQL

Public Instance Methods

dataset(opts=nil) click to toggle source

Return an instance of Sequel::ODBC::MSSQL::Dataset with the given opts.

# File lib/sequel/adapters/odbc/mssql.rb, line 13
def dataset(opts=nil)
  Sequel::ODBC::MSSQL::Dataset.new(self, opts)
end
execute_insert(sql, opts={}) click to toggle source

Return the last inserted identity value.

# File lib/sequel/adapters/odbc/mssql.rb, line 18
def execute_insert(sql, opts={})
  synchronize(opts[:server]) do |conn|
    begin
      log_yield(sql){conn.do(sql)}
      begin
        s = log_yield(LAST_INSERT_ID_SQL){conn.run(LAST_INSERT_ID_SQL)}
        if (rows = s.fetch_all) and (row = rows.first)
          Integer(row.first)
        end
      ensure
        s.drop if s
      end
    rescue ::ODBC::Error => e
      raise_error(e)
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.