Class | Sequel::Oracle::Dataset |
In: |
lib/sequel/adapters/oracle.rb
|
Parent: | Sequel::Dataset |
DatasetClass | = | self |
PREPARED_ARG_PLACEHOLDER | = | ':'.freeze |
Execute the given type of statement with the hash of values.
# File lib/sequel/adapters/oracle.rb, line 396 396: def call(type, bind_vars={}, *values, &block) 397: ps = to_prepared_statement(type, values) 398: ps.extend(BindArgumentMethods) 399: ps.call(bind_vars, &block) 400: end
# File lib/sequel/adapters/oracle.rb, line 402 402: def fetch_rows(sql) 403: execute(sql) do |cursor| 404: cps = db.conversion_procs 405: cols = columns = cursor.get_col_names.map{|c| output_identifier(c)} 406: metadata = cursor.column_metadata 407: cm = cols.zip(metadata).map{|c, m| [c, cps[m.data_type]]} 408: @columns = columns 409: while r = cursor.fetch 410: row = {} 411: r.zip(cm).each{|v, (c, cp)| row[c] = ((v && cp) ? cp.call(v) : v)} 412: yield row 413: end 414: end 415: self 416: end
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.
# File lib/sequel/adapters/oracle.rb, line 421 421: def prepare(type, name=nil, *values) 422: ps = to_prepared_statement(type, values) 423: ps.extend(PreparedStatementMethods) 424: if name 425: ps.prepared_statement_name = name 426: db.set_prepared_statement(name, ps) 427: end 428: ps 429: end