Module: Sequel::Oracle::DatabaseMethods

Included in:
JDBC::Oracle::DatabaseMethods, Database
Defined in:
lib/sequel_core/adapters/shared/oracle.rb

Instance Method Summary collapse

Instance Method Details

#table_exists?(name) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/sequel_core/adapters/shared/oracle.rb', line 12

def table_exists?(name)
  from(:tab).filter(:tname =>dataset.send(:input_identifier, name), :tabtype => 'TABLE').count > 0
end

#tables(opts = {}) ⇒ Object



7
8
9
10
# File 'lib/sequel_core/adapters/shared/oracle.rb', line 7

def tables(opts={})
  ds = from(:tab).server(opts[:server]).select(:tname).filter(:tabtype => 'TABLE')
  ds.map{|r| ds.send(:output_identifier, r[:tname])}
end