Class | Sequel::ODBC::Dataset
In: | lib/sequel/adapters/odbc.rb
Parent: | Sequel::Dataset

### Methods

fetch_rows

### Constants

BOOL_TRUE | = | '1'.freeze
BOOL_FALSE | = | '0'.freeze
ODBC_DATE_FORMAT | = | "{d '%Y-%m-%d'}".freeze
TIMESTAMP_FORMAT | = | "{ts '%Y-%m-%d %H:%M:%S'}".freeze
DatasetClass | = | self

### Public Instance methods

fetch_rows(sql) {|hash| ...}

[Source]

         # File lib/sequel/adapters/odbc.rb, line 103
    103:       def fetch_rows(sql)
    104:         execute(sql) do |s|
    105:           i = -1
    106:           cols = s.columns(true).map{|c| [output_identifier(c.name), i+=1]}
    107:           columns = cols.map{|c| c.at(0)}
    108:           if opts[:offset] && offset_returns_row_number_column?
    109:             rn = row_number_column
    110:             columns.delete(rn)
    111:           end
    112:           @columns = columns
    113:           if rows = s.fetch_all
    114:             rows.each do |row|
    115:               hash = {}
    116:               cols.each{|n,i| hash[n] = convert_odbc_value(row[i])}
    117:               hash.delete(rn) if rn
    118:               yield hash
    119:             end
    120:           end
    121:         end
    122:         self
    123:       end

[Validate]