Class: Avmtrf1::Oracle::Objects::Relation

Inherits:
Object
  • Object
show all
Defined in:
lib/avmtrf1/oracle/objects/relation.rb

Instance Method Summary collapse

Instance Method Details

#countObject


17
18
19
# File 'lib/avmtrf1/oracle/objects/relation.rb', line 17

def count
  connection.unique_value("select * from (#{sql})").to_i
end

#eachObject


11
12
13
14
15
# File 'lib/avmtrf1/oracle/objects/relation.rb', line 11

def each
  connection.query(sql).fetch_hash do |row|
    yield(::Avmtrf1::Oracle::Objects.row_to_object(connection, row))
  end
end