Class | Sequel::Oracle::Dataset |
In: |
lib/sequel/adapters/oracle.rb
|
Parent: | Sequel::Dataset |
DatasetClass | = | self |
PREPARED_ARG_PLACEHOLDER | = | ':'.freeze |
BindArgumentMethods | = | prepared_statements_module(:bind, ArgumentMapper) |
PreparedStatementMethods | = | prepared_statements_module(:prepare, BindArgumentMethods) |
Execute the given type of statement with the hash of values.
# File lib/sequel/adapters/oracle.rb, line 355 355: def call(type, bind_vars={}, *values, &block) 356: ps = to_prepared_statement(type, values) 357: ps.extend(BindArgumentMethods) 358: ps.call(bind_vars, &block) 359: end
# File lib/sequel/adapters/oracle.rb, line 361 361: def fetch_rows(sql) 362: execute(sql) do |cursor| 363: cps = db.conversion_procs 364: cols = columns = cursor.get_col_names.map{|c| output_identifier(c)} 365: metadata = cursor.column_metadata 366: cm = cols.zip(metadata).map{|c, m| [c, cps[m.data_type]]} 367: self.columns = columns 368: while r = cursor.fetch 369: row = {} 370: r.zip(cm).each{|v, (c, cp)| row[c] = ((v && cp) ? cp.call(v) : v)} 371: yield row 372: end 373: end 374: self 375: 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 380 380: def prepare(type, name=nil, *values) 381: ps = to_prepared_statement(type, values) 382: ps.extend(PreparedStatementMethods) 383: if name 384: ps.prepared_statement_name = name 385: db.set_prepared_statement(name, ps) 386: end 387: ps 388: end