Module: Sequel::Oracle::DatasetMethods

Included in:
JDBC::Oracle::Dataset, Dataset
Defined in:
lib/sequel/adapters/shared/oracle.rb

Constant Summary collapse

SELECT_CLAUSE_METHODS =
Dataset.clause_methods(:select, %w'with distinct columns from join where group having compounds order limit lock')

Instance Method Summary collapse

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


115
116
117
# File 'lib/sequel/adapters/shared/oracle.rb', line 115

def empty?
  db[:dual].where(exists).get(1) == nil
end

#except(dataset, opts = {}) ⇒ Object

Oracle uses MINUS instead of EXCEPT, and doesn’t support EXCEPT ALL

Raises:



109
110
111
112
113
# File 'lib/sequel/adapters/shared/oracle.rb', line 109

def except(dataset, opts={})
  opts = {:all=>opts} unless opts.is_a?(Hash)
  raise(Sequel::Error, "EXCEPT ALL not supported") if opts[:all]
  compound_clone(:minus, dataset, opts)
end

#insert(*args) ⇒ Object

If this dataset is associated with a sequence, return the most recently inserted sequence value.



121
122
123
124
125
126
127
128
# File 'lib/sequel/adapters/shared/oracle.rb', line 121

def insert(*args)
  r = super
  if s = opts[:sequence]
    with_sql("SELECT #{literal(s)}.currval FROM dual").single_value.to_i
  else
    r
  end
end

#requires_sql_standard_datetimes?Boolean

Oracle requires SQL standard datetimes

Returns:

  • (Boolean)


131
132
133
# File 'lib/sequel/adapters/shared/oracle.rb', line 131

def requires_sql_standard_datetimes?
  true
end

#sequence(s) ⇒ Object

Create a copy of this dataset associated to the given sequence name, which will be used when calling insert to find the most recently inserted value for the sequence.



138
139
140
# File 'lib/sequel/adapters/shared/oracle.rb', line 138

def sequence(s)
  clone(:sequence=>s)
end

#supports_intersect_except_all?Boolean

Oracle does not support INTERSECT ALL or EXCEPT ALL

Returns:

  • (Boolean)


143
144
145
# File 'lib/sequel/adapters/shared/oracle.rb', line 143

def supports_intersect_except_all?
  false
end

#supports_timestamp_timezones?Boolean

Oracle supports timezones in literal timestamps.

Returns:

  • (Boolean)


148
149
150
# File 'lib/sequel/adapters/shared/oracle.rb', line 148

def supports_timestamp_timezones?
  true
end

#supports_window_functions?Boolean

Oracle supports window functions

Returns:

  • (Boolean)


153
154
155
# File 'lib/sequel/adapters/shared/oracle.rb', line 153

def supports_window_functions?
  true
end