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 398 398: def call(type, bind_vars={}, *values, &block) 399: ps = to_prepared_statement(type, values) 400: ps.extend(BindArgumentMethods) 401: ps.call(bind_vars, &block) 402: end
# File lib/sequel/adapters/oracle.rb, line 404 404: def fetch_rows(sql) 405: execute(sql) do |cursor| 406: cps = db.conversion_procs 407: cols = columns = cursor.get_col_names.map{|c| output_identifier(c)} 408: metadata = cursor.column_metadata 409: cm = cols.zip(metadata).map{|c, m| [c, cps[m.data_type]]} 410: @columns = columns 411: while r = cursor.fetch 412: row = {} 413: r.zip(cm).each{|v, (c, cp)| row[c] = ((v && cp) ? cp.call(v) : v)} 414: yield row 415: end 416: end 417: self 418: 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 423 423: def prepare(type, name=nil, *values) 424: ps = to_prepared_statement(type, values) 425: ps.extend(PreparedStatementMethods) 426: if name 427: ps.prepared_statement_name = name 428: db.set_prepared_statement(name, ps) 429: end 430: ps 431: end