class Sequel::Oracle::Dataset

  1. lib/sequel/adapters/oracle.rb
Parent: Oracle

Included modules

  1. DatasetMethods

Constants

DatasetClass = self  
PREPARED_ARG_PLACEHOLDER = ':'.freeze  

Public Instance methods

call (type, bind_vars={}, *values, &block)

Execute the given type of statement with the hash of values.

[show source]
# File lib/sequel/adapters/oracle.rb, line 396
def call(type, bind_vars={}, *values, &block)
  ps = to_prepared_statement(type, values)
  ps.extend(BindArgumentMethods)
  ps.call(bind_vars, &block)
end
fetch_rows (sql)
[show source]
# File lib/sequel/adapters/oracle.rb, line 402
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]]}
    @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
prepare (type, name=nil, *values)

Prepare the given type of query with the given name and store it in the database. Note that a new native prepared statement is created on each call to this prepared statement.

[show source]
# File lib/sequel/adapters/oracle.rb, line 421
def prepare(type, name=nil, *values)
  ps = to_prepared_statement(type, values)
  ps.extend(PreparedStatementMethods)
  if name
    ps.prepared_statement_name = name
    db.set_prepared_statement(name, ps)
  end
  ps
end
requires_placeholder_type_specifiers? ()

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

[show source]
# File lib/sequel/adapters/oracle.rb, line 434
def requires_placeholder_type_specifiers?
  true
end