The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

RDBAL - Relational DataBase Abstraction Layer class (ReDBALl)

SYNOPSIS

     use RDBAL;
     
     $connection = RDBAL::Connect('username', 'password', 'server');

     $connection->Query("SQL query"); # Execute an SQL select and return the results in an array

     $connection->Sql("SQL command(s)"); #      Execute an arbitrary SQL command

     $connection->PrintTable(); #       print the results of the most recent select

     $connection->PrintTables(); #      print the results of one or more selects

     $connection->ColumnNames(); #      get column names for results table

     $connection->ColumnTypes(); #      get column data types for results table

     $connection->ColumnLengths(); #    get column lengths for results table

DESCRIPTION

RDBAL is a perl module to work with a SQL Relational database. A middle layer driver may be written for any database connection layer. It is also possible to write middle layer drivers which would parse SQL statements and implement them in some arbitrary fashion.

Currently available are: Pg (PostgreSQL), Apache::Sybase::DBlib, Sybase::DBlib, ODBC middle layer drivers, and dbi:Sybase.

The presence of a given middle layer driver may be checked by checking to see if: $RDBAL::Layer{'Pg'}, $RDBAL::Layer{'ApacheSybaseDBlib'}, $RDBAL::Layer{'SybaseDBlib'}, $RDBAL::Layer{'ODBC'}, or $RDBAL::Layer{'dbi:Sybase'} is defined.

FUNCTIONS

$connection = RDBAL::Connect('username', 'password', 'server', ['preferred_layer']);

Create/get a connection to a database (server).

Username and password are mandatory for database servers which require logins. For Win32::ODBC, server is the name of an existing DSN.

Possible values for preferred_layer are (in the order of default preference):

Pg
ApacheSybaseDBlib
SybaseDBlib
ODBC
dbi:Sybase
dbi:Oracle

$connection->Query("SQL query")

Execute an SQL select and return the results in an array.

$connection->Sql("SQL command(s)")

execute an arbitrary SQL command.

$connection->RowCount()

Fetch the number of rows that were affected by the previous SQL command.

@row = $connection->NextRow();

fetch the next row from a result set

$bool_regular_row = $connection->Regular_Row();

see if the row just fetched is a regular data set row

$bool_no_more_result_sets = $connection->More_Results();

see if there are any more result sets

$connection->PrintTable()

Print the results of the most recent select.

$connection->PrintTables()

Print the results of one or more selects.

$connection->ColumnNames()

Get column names for results table.

$connection->ColumnTypes()

Get column data types for results table.

$connection->ColumnLengths()

Get column lengths for results table.

REPORTING BUGS

When reporting bugs/problems please include as much information as possible.

A small script which yields the problem will probably be of help. If you cannot include a small script then please include a Debug trace from a run of your program which does yield the problem.

AUTHOR INFORMATION

Brian H. Dunford-Shore brian@ibc.wustl.edu

Copyright 1998, Washington University School of Medicine, Institute for Biomedical Computing. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Address bug reports and comments to: www@ibc.wustl.edu

TODO

These are features that would be nice to have and might even happen someday (especially if YOU write it).

Other types of database servers:

(mSQL, mySQL, etc.).

SEE ALSO

Sybase::DBlib -- http://www.ibc.wustl.edu/perl5/other/sybperl.html

Win32::odbc -- http://www.ibc.wustl.edu/perl5/other/Win32/odbc.html

CREDITS

Thanks very much to:

David J. States (states@ibc.wustl.edu)

and

Fyodor Krasnov (fyodor@bws.aha.ru)

     for suggestions and bug fixes.

BUGS

You really mean 'extra' features ;). None known.

COPYRIGHT

Copyright (c) 1997, 1998, 1999 Washington University, St. Louis, Missouri. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.