Flowdock
method

select

Importance_0
v1.0.0 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::OCIAdapter
  • 1.0.0 (0)
  • 1.1.1
  • 1.1.6
  • 1.2.0
  • 1.2.6
  • 2.0.0
  • 2.0.3
  • 2.1.0
  • 2.2.1
  • 2.3.2
  • 2.3.8
  • 3.0.0
  • 3.0.5
  • 3.0.9
  • 3.1.0
  • 3.2.1
  • 3.2.3
  • 3.2.8
  • 3.2.13
  • 4.0.2
  • What's this?
select(sql, name = nil) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/oci_adapter.rb, line 453
        def select(sql, name = nil)
          cursor = log(sql, name) { @connection.exec sql }
          cols = cursor.get_col_names.map { |x| oci_downcase(x) }
          rows = []

          while row = cursor.fetch
            hash = Hash.new

            cols.each_with_index do |col, i|
              hash[col] =
                case row[i]
                when OCI8::LOB
                  name == 'Writable Large Object' ? row[i]: row[i].read
                when OraDate
                  (row[i].hour == 0 and row[i].minute == 0 and row[i].second == 0) ?
                  row[i].to_date : row[i].to_time
                else row[i]
                end unless col == 'raw_rnum_'
            end

            rows << hash
          end

          rows
        ensure
          cursor.close if cursor
        end
Register or log in to add new notes.