oci_adapter.rb

Path: vendor/activerecord/lib/active_record/connection_adapters/oci_adapter.rb
Last Update: Mon Mar 07 02:56:06 CET 2005

Implementation notes:

  1. I had to redefine a method in ActiveRecord to make it possible to implement an autonumbering solution for oracle. It’s implemented in a way that is intended to not break other adapters.
  2. Default value support needs a patch to the OCI8 driver, to enable it to read LONG columns. LONG is deprecated, and so may never be properly added to driver. A similar patch is needed for TIMESTAMP. This is dangerous because it may break with newer versions of the driver.
  3. Large Object support works by an after_save callback added to the ActiveRecord. This is not a problem - you can add other (chained) after_save callbacks.
  4. LIMIT and OFFSET work by scrolling through a cursor - no rownum select from select required. It does mean that large OFFSETs will have to scroll through the intervening records. To keep consistency with other adapters I’ve allowed the LIMIT and OFFSET clauses to be included in the sql string and later extracted them by parsing the string.

Do what you want with this code, at your own peril, but if any significant portion of my code remains then please acknowledge my contribution. Copyright 2005 Graham Jenkins $Revision: 1.2 $

Required files

active_record/connection_adapters/abstract_adapter  

[Validate]