RDBAL - Relational DataBase Abstraction Layer class (ReDBALl)
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
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.
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):
Execute an SQL select and return the results in an array.
execute an arbitrary SQL command.
Fetch the number of rows that were affected by the previous SQL command.
fetch the next row from a result set
see if the row just fetched is a regular data set row
see if there are any more result sets
Print the results of the most recent select.
Print the results of one or more selects.
Get column names for results table.
Get column data types for results table.
Get column lengths for results table.
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.
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
These are features that would be nice to have and might even happen someday (especially if YOU write it).
(mSQL, mySQL, etc.).
Sybase::DBlib -- http://www.ibc.wustl.edu/perl5/other/sybperl.html
Win32::odbc -- http://www.ibc.wustl.edu/perl5/other/Win32/odbc.html
Thanks very much to:
David J. States (states@ibc.wustl.edu)
and
Fyodor Krasnov (fyodor@bws.aha.ru)
for suggestions and bug fixes.
You really mean 'extra' features ;). None known.
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.
To install RDBAL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RDBAL
CPAN shell
perl -MCPAN -e shell install RDBAL
For more information on module installation, please visit the detailed CPAN module installation guide.