class Sequel::Oracle::Dataset

Constants

BindArgumentMethods
PREPARED_ARG_PLACEHOLDER
PreparedStatementMethods

Public Instance Methods

fetch_rows(sql) { |row| ... } click to toggle source
# File lib/sequel/adapters/oracle.rb, line 363
def fetch_rows(sql)
  execute(sql) do |cursor|
    cps = db.conversion_procs
    cols = columns = cursor.get_col_names.map{|c| output_identifier(c)}
    metadata = cursor.column_metadata
    cm = cols.zip(metadata).map{|c, m| [c, cps[m.data_type]]}
    self.columns = columns
    while r = cursor.fetch
      row = {}
      r.zip(cm).each{|v, (c, cp)| row[c] = ((v && cp) ? cp.call(v) : v)}
      yield row
    end
  end
  self
end
requires_placeholder_type_specifiers?() click to toggle source

Oracle requires type specifiers for placeholders, at least if you ever want to use a nil/NULL value as the value for the placeholder.

# File lib/sequel/adapters/oracle.rb, line 382
def requires_placeholder_type_specifiers?
  true
end

Private Instance Methods

bound_variable_modules() click to toggle source
# File lib/sequel/adapters/oracle.rb, line 404
def bound_variable_modules
  [BindArgumentMethods]
end
literal_other_append(sql, v) click to toggle source
Calls superclass method Sequel::Dataset#literal_other_append
# File lib/sequel/adapters/oracle.rb, line 388
def literal_other_append(sql, v)
  case v
  when OraDate
    literal_append(sql, db.to_application_timestamp(v))
  when OCI8::CLOB
    v.rewind
    literal_append(sql, v.read)
  else
    super
  end
end
prepared_arg_placeholder() click to toggle source
# File lib/sequel/adapters/oracle.rb, line 400
def prepared_arg_placeholder
  PREPARED_ARG_PLACEHOLDER
end
prepared_statement_modules() click to toggle source
# File lib/sequel/adapters/oracle.rb, line 408
def prepared_statement_modules
  [PreparedStatementMethods]
end