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_TIMESTAMP_FORMAT | = | "{ts '%Y-%m-%d %H:%M:%S'}".freeze
ODBC_TIMESTAMP_AFTER_SECONDS | = | ODBC_TIMESTAMP_FORMAT.index( '%S' ).succ - ODBC_TIMESTAMP_FORMAT.length
ODBC_DATE_FORMAT | = | "{d '%Y-%m-%d'}".freeze
UNTITLED_COLUMN | = | 'untitled_%d'.freeze

### Public Instance methods

fetch_rows(sql) {|hash_row(row)}| ...}

[Source]

         # File lib/sequel/adapters/odbc.rb, line 105
    105:       def fetch_rows(sql, &block)
    106:         execute(sql) do |s|
    107:           begin
    108:             untitled_count = 0
    109:             @columns = s.columns(true).map do |c|
    110:               if (n = c.name).empty?
    111:                 n = UNTITLED_COLUMN % (untitled_count += 1)
    112:               end
    113:               output_identifier(n)
    114:             end
    115:             rows = s.fetch_all
    116:             rows.each {|row| yield hash_row(row)} if rows
    117:           ensure
    118:             s.drop unless s.nil? rescue nil
    119:           end
    120:         end
    121:         self
    122:       end

[Validate]