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