Class | Sequel::Oracle::Dataset
In: | lib/sequel/adapters/oracle.rb
Parent: | Sequel::Dataset

### Methods

call fetch_rows prepare requires_placeholder_type_specifiers?

### Included Modules

DatasetMethods

### Classes and Modules

Module Sequel::Oracle::Dataset::ArgumentMapper
Module Sequel::Oracle::Dataset::BindArgumentMethods
Module Sequel::Oracle::Dataset::PreparedStatementMethods

### 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.

[Source]

         # File lib/sequel/adapters/oracle.rb, line 367
    367:       def call(type, bind_vars={}, *values, &block)
    368:         ps = to_prepared_statement(type, values)
    369:         ps.extend(BindArgumentMethods)
    370:         ps.call(bind_vars, &block)
    371:       end

fetch_rows(sql) {|row| ...}

[Source]

         # File lib/sequel/adapters/oracle.rb, line 373
    373:       def fetch_rows(sql)
    374:         execute(sql) do |cursor|
    375:           offset = @opts[:offset]
    376:           rn = row_number_column
    377:           cps = db.conversion_procs
    378:           cols = columns = cursor.get_col_names.map{|c| output_identifier(c)}
    379:           metadata = cursor.column_metadata
    380:           cm = cols.zip(metadata).map{|c, m| [c, cps[m.data_type]]}
    381:           columns = cols.reject{|x| x == rn} if offset
    382:           @columns = columns
    383:           while r = cursor.fetch
    384:             row = {}
    385:             r.zip(cm).each{|v, (c, cp)| row[c] = ((v && cp) ? cp.call(v) : v)}
    386:             row.delete(rn) if offset
    387:             yield row
    388:           end
    389:         end
    390:         self
    391:       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.

[Source]

         # File lib/sequel/adapters/oracle.rb, line 396
    396:       def prepare(type, name=nil, *values)
    397:         ps = to_prepared_statement(type, values)
    398:         ps.extend(PreparedStatementMethods)
    399:         if name
    400:           ps.prepared_statement_name = name
    401:           db.set_prepared_statement(name, ps)
    402:         end
    403:         ps
    404:       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.

[Source]

         # File lib/sequel/adapters/oracle.rb, line 409
    409:       def requires_placeholder_type_specifiers?
    410:         true
    411:       end

[Validate]