Class/Module Index [+]

Quicksearch

Sequel::Oracle::Database

Constants

CONNECTION_ERROR_CODES

ORA-00028: your session has been killed ORA-01012: not logged on ORA-03113: end-of-file on communication channel ORA-03114: not connected to ORACLE

ORACLE_TYPES
PS_TYPES

Attributes

conversion_procs[R]

Hash of conversion procs for this database.

Public Class Methods

new(opts={}) click to toggle source
# File lib/sequel/adapters/oracle.rb, line 24
def initialize(opts={})
  super
  @autosequence = opts[:autosequence]
  @primary_key_sequences = {}
  @conversion_procs = ORACLE_TYPES.dup
end

Public Instance Methods

connect(server) click to toggle source
# File lib/sequel/adapters/oracle.rb, line 31
def connect(server)
  opts = server_opts(server)
  if opts[:database]
    dbname = opts[:host] ?              "//#{opts[:host]}#{":#{opts[:port]}" if opts[:port]}/#{opts[:database]}" : opts[:database]
  else
    dbname = opts[:host]
  end
  conn = OCI8.new(opts[:user], opts[:password], dbname, opts[:privilege])
  if prefetch_rows = opts.fetch(:prefetch_rows, 100)
    conn.prefetch_rows = typecast_value_integer(prefetch_rows)
  end
  conn.autocommit = true
  conn.non_blocking = true
  
  # The ruby-oci8 gem which retrieves oracle columns with a type of
  # DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE is complex based on the
  # ruby version (1.9.2 or later) and Oracle version (9 or later)
  # In the now standard case of 1.9.2 and Oracle 9 or later, the timezone
  # is determined by the Oracle session timezone. Thus if the user
  # requests Sequel provide UTC timezone to the application,
  # we need to alter the session timezone to be UTC
  if Sequel.application_timezone == :utc
    conn.exec("ALTER SESSION SET TIME_ZONE='-00:00'")
  end
  
  class << conn
    attr_reader :prepared_statements
  end
  conn.instance_variable_set(:@prepared_statements, {})
  
  conn
end
disconnect_connection(c) click to toggle source
# File lib/sequel/adapters/oracle.rb, line 65
def disconnect_connection(c)
  c.logoff
rescue OCIInvalidHandle
  nil
end
do(sql, opts={}, &block) click to toggle source
Alias for: execute
execute(sql, opts={}, &block) click to toggle source
# File lib/sequel/adapters/oracle.rb, line 71
def execute(sql, opts={}, &block)
  _execute(nil, sql, opts, &block)
end
Also aliased as: do
execute_insert(sql, opts={}) click to toggle source
# File lib/sequel/adapters/oracle.rb, line 76
def execute_insert(sql, opts={})
  _execute(:insert, sql, opts)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.