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

Methods

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

[Source]

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

[Validate]