Class | ActiveRecord::ConnectionAdapters::OracleAdapter |
In: |
lib/active_record/connection_adapters/oracle_adapter.rb
|
Parent: | AbstractAdapter |
This is an Oracle/OCI adapter for the ActiveRecord persistence framework. It relies upon the OCI8 driver, which works with Oracle 8i and above. Most recent development has been on Debian Linux against a 10g database, ActiveRecord 1.12.1 and OCI8 0.1.13. See: rubyforge.org/projects/ruby-oci8/
Usage notes:
Required parameters:
ORDER BY clause for the passed order option.
Uses column aliases as defined by distinct.
SELECT DISTINCT clause for a given set of columns and a given ORDER BY clause.
Oracle requires the ORDER BY columns to be in the SELECT list for DISTINCT queries. However, with those columns included in the SELECT DISTINCT list, you won‘t actually get a distinct list of the column you want (presuming the column has duplicates with multiple values for the ordered-by columns. So we use the FIRST_VALUE function to get a single (first) value for each column, effectively making every row the same.
distinct("posts.id", "posts.created_at desc")
Returns the next sequence value from a sequence generator. Not generally called directly; used by ActiveRecord to get the next primary key value when inserting a new database record (see prefetch_primary_key?).
Find a table‘s primary key and sequence. Note: Only primary key is implemented - sequence will be nil.
Returns true for Oracle adapter (since Oracle requires primary key values to be pre-fetched before insert). See also next_sequence_value.