lib/odbc_adapter/adapters/snowflake_odbc_adapter.rb
# Override dbms_type_cast to get the values encoded in UTF-8
Override dbms_type_cast to get the values encoded in UTF-8
Override dbms_type_cast to get the values encoded in UTF - 8
def dbms_type_cast(columns, values)
        int_column = {}
        columns.each_with_index do |c, i|
          int_column[i] = c.type == 3 && c.scale.zero?
        end
        float_column = {}
        columns.each_with_index do |c, i|
          float_column[i] = c.type == 3 && !c.scale.zero?
        end
        values.each do |row|
          row.each_index do |idx|
            val = row[idx]
            if val
              if int_column[idx]
                row[idx] = val.to_i
              elsif float_column[idx]
                row[idx] = val.to_f
              elsif val.is_a?(String)
                row[idx] = val.force_encoding('UTF-8')
              end
            end
          end
        end
      end
def dbms_type_cast ( columns , values ) int_column = { } columns . each_with_index do | c , i | int_column [ i ] = c . type == 3 && c . scale . zero? end float_column = { } columns . each_with_index do | c , i | float_column [ i ] = c . type == 3 && ! c . scale . zero? end values . each do | row | row . each_index do | idx | val = row [ idx ] if val if int_column [ idx ] row [ idx ] = val . to_i elsif float_column [ idx ] row [ idx ] = val . to_f elsif val . is_a? ( String ) row [ idx ] = val . force_encoding ( 'UTF-8' ) end end end end end
Override dbms_type_cast to get the values encoded in UTF-8
Override dbms_type_cast to get the values encoded in UTF - 8
columns
<not_specific>
values
<not_specific>