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