Module Informix
In: lib/informix.rb
lib/informix/interval.rb
lib/informix/scrollcursor.rb
lib/informix/seqcursor.rb
lib/informix/exceptions.rb
ext/informixc.c

The Informix module contains the mechanisms for connecting to and taking advantage of an existing Informix database by means of a simple model, similar to the one used in ESQL/C.

The interaction with an Informix database is made basically through three classes: Database, Statement and Cursor.

Cursor is actually a module that works as a shortcut for creating three kinds of cursors: SequentialCursor, ScrollCursor and InsertCursor.

There are other classes for supporting some data types not available in Ruby: Slob, SlobStat and Interval.

Again, Interval is actually a module that works as a shortcut for creating two kinds of intervals: IntervalYTM and IntervalDTS.

Methods

connect   version  

Classes and Modules

Module Informix::Cursor
Module Informix::Interval
Class Informix::CursorBase
Class Informix::DataError
Class Informix::Database
Class Informix::DatabaseError
Class Informix::Error
Class Informix::ExcInfo
Class Informix::InsertCursor
Class Informix::IntegrityError
Class Informix::InterfaceError
Class Informix::InternalError
Class Informix::IntervalBase
Class Informix::IntervalDTS
Class Informix::IntervalYTM
Class Informix::NotSupportedError
Class Informix::OperationalError
Class Informix::ProgrammingError
Class Informix::ScrollCursor
Class Informix::SequentialCursor
Class Informix::Slob
Class Informix::Statement
Class Informix::Warning

Constants

VERSION = "0.7.0"
ExcInfo = Struct.new(:sql_code, :sql_state, :class_origin, :subclass_origin, :message, :server_name, :connection_name)

Public Class methods

Shortcut to create a Database object connected to dbname as user with password. If these are not given, connects to dbname as the current user.

The Database object is passed to the block if it‘s given, and automatically closes the connection when the block terminates, returning the value of the block.

Examples:

Connecting to stores with our current credentials:

  db = Informix.connect('stores')

Same thing, using a block and using a different server. The connection is closed automatically when the block terminates.

  result = Informix.connect('stores@server_shm') do |db|
    # do something with db
    # the last expression evaluated will be returned
  done

[Source]

    # File lib/informix.rb, line 57
57:   def self.connect(dbname, user = nil, password = nil, &block)
58:     Database.open(dbname, user, password, &block)
59:   end

Returns the version of this Ruby/Informix driver. Note that this is NOT the Informix database version.

  Informix.version => string

[Source]

    # File lib/informix.rb, line 65
65:   def self.version
66:     VERSION
67:   end

[Validate]