James H. Zisch - Computer Services

Support : Guides

 

PERL DBI (Database Independence)

JHZ-CS Web Application Systems Solutions and Development Services utilize a combination of flat file data and RDBMS (Relational Database Management System). This approach supports an evolution strategy for enhancing technological capabilities as requirements increase. Data interfaces are designed to use the PERL DBI (Database Independence) interface. PERL DBI supports numerous DBMS (Database Management Systems) products and provides for easy migration of data across numerous database products for an added level of flexibility. This approach avoids a common pitfall of locking into dependent technologies that may prevent the ability to transition to a new or different computer platform in the future.

You will find links to PERL resources in the GUIDES: Resource Links page.

Support Database Systems

PERL DBI provides interface capabilities with the most commonly used databases including: Oracle, Ingres, Sybase, DB2, Informix, xBase, mSQL, MySQL; as well as, MS SQL via ODBC and all other ODBC supportive DBMS's. The use of a DBMS provides management access to data with built-in capabilities of handling massive amounts of data. PERL achieve database independence by providing a single application interface to numerous DBD's (Database Drivers).

The following provides an overview of the PERL DBI's basic components and functions.

NOTE: PERL DBI module is not a JHZ-CS product. This information is provided for information purposes only.

PERL DBI Dialect

  • DBI API (Application Interface)
  • DBI Handle Objects
  • Database Objects
  • Statements Objects

The logical process of standard database interface involves a flow of initialization, process, then termination, with open and close functionality as follows:

  1. INITIALIZE
  2. OPEN
  3. PROCESS (Typical functions of retrieving, inserting, modifying and deleting data)
  4. CLOSE
  5. TERMINATE

The PERL DBI API is structured using an object oriented architecture as are most PERL modules, packages and other API's.

OPEN and CLOSE are implied with the PERL DBI. The INITIALIZE and OPEN processes are combined within the "connect" DBI method. CLOSE and TERMINATE processes are combined within the "disconnect" within the DBI Database Handle Object methods.

The "connect" method returns a Database Object Handle. Subsequent operations use the returned handle to access the particular database's functions and data. The "disconnect" method releases the database and the memory used while it was connected.

DBI API

Methods

Initiating the DBI API are the connectivity interfaces.

  • connect
  • connect_cached
  • available_drivers
  • data_sources
  • trace

Utility Functions

Functions providing platform character manipulations.

  • neat
  • neat_list
  • looks_like_number

Dynamic Attributes

Informational data items reflecting current API state.

  • err
  • errstr
  • state
  • rows

Handle Objects

Methods

Operations against specific handles.

  • err
  • errstr
  • state
  • trace
  • trace_msg
  • func

Attributes

Informational data items reflecting current DB Handle states.

  • Warn
  • Active
  • Kids
  • ActiveKids
  • CachedKids
  • CompatMode
  • InactiveDestory
  • PrintError
  • RaiseError
  • ChopBlanks
  • LongReadLen
  • LongTruncOk
  • Taint
  • private_*

Database Handle Objects

Methods

  • selectrow_array
  • selectall_arrayref
  • selectcol_arrayref
  • prepare
  • prepare_cached
  • do (use with non-select statements)
  • commit
  • rollback
  • disconnect
  • ping
  • table_info
  • tables
  • type_info_all
  • type_info
  • quote

Attributes

  • AutoCommit
  • Driver
  • Name
  • RowCacheSize

Statement Handle Objects

Objects

  • bind_param
  • bind_param_inout
  • execute
  • fetchrow_arrayref
  • fetchrow_array
  • fetchrow_hashref
  • fetchall_arrayref
  • finish
  • rows
  • bind_col
  • bind_columns
  • dump_results

Attributes

  • NUM_OF_FIELDS
  • NUM_OF_PARAMS
  • NAME
  • NAME_lc
  • NAME_uc
  • TYPE
  • PRECISION
  • SCALE
  • NULLABLE
  • CursorName
  • Statement
  • RowsInCache