Anansi::Database::Oracle - A manager for Oracle databases.
use Anansi::Database::Oracle; if(Anansi::Database::Oracle->validate( undef, DRIVER => 'Oracle', )) { my $OBJECT = Anansi::Database::Oracle->new(); if($OBJECT->connect( undef, DATABASE => 'someDatabase', PASSWORD => 'somePassword', USERNAME => 'someUser', )) { my $records = $OBJECT->statement( undef, INPUT => [ { DEFAULT => '0', NAME => 'yetAnotherField', } ], SQL => 'SELECT some_field, another_field FROM some_table WHERE yet_another_field = ?;', yetAnotherField => 123, ); $OBJECT->disconnect(); if(defined($records)) { if(ref($records) =~ /^ARRAY$/i) { my $record = 0; foreach my $record (@{$records}) { next if(ref($record) !~ /^HASH$/i); print "\n" if(0 < $record); my $field = 0; foreach my $key (keys(%{$record})) { print ', ' if(0 < $field); print '"'.$key.'" = "'.${record}{$key}.'"'; $field++; } $record++; } print "\n"; } } } } use Anansi::Database; my $OBJECT = Anansi::Database->new(); my $component = $OBJECT->addComponent( undef, DRIVER => 'Oracle', ); if(defined($component)) { if($OBJECT->channel( 'CONNECT', $component, DATABASE => 'someDatabase', PASSWORD => 'somePassword', USERNAME => 'someUser', )) { my $records = $OBJECT->channel( 'STATEMENT', $component, INPUT => [ { DEFAULT => '0', NAME => 'yetAnotherField', } ], SQL => 'SELECT some_field, another_field FROM some_table WHERE yet_another_field = ?;', yetAnotherField => 123, ); if(defined($records)) { if(ref($records) =~ /^ARRAY$/i) { my $record = 0; foreach my $record (@{$records}) { next if(ref($record) !~ /^HASH$/i); print "\n" if(0 < $record); my $field = 0; foreach my $key (keys(%{$record})) { print ', ' if(0 < $field); print '"'.$key.'" = "'.${record}{$key}.'"'; $field++; } $record++; } print "\n"; } } } }
Manages Oracle databases allowing the opening and closing of Oracle databases.
See Anansi::Class for details. A parent module of Anansi::Component.
See Anansi::Class::DESTROY for details.
See Anansi::Class::finalise for details. Overridden by Anansi::DatabaseComponent::finalise. A virtual method.
See Anansi::Class::implicate for details. A virtual method.
See Anansi::Class::import for details.
See Anansi::Class::initialise for details. Overridden by Anansi::DatabaseComponent::initialise. A virtual method.
See Anansi::Class::new for details.
See Anansi::Class::old for details.
See Anansi::Class::used for details.
See Anansi::Class::uses for details.
See Anansi::Class::using for details.
See Anansi::Component for details. A parent module of Anansi::DatabaseComponent.
See Anansi::Component::addChannel for details.
See Anansi::Component::channel for details.
See Anansi::Component::componentManagers for details.
See Anansi::Component::removeChannel for details.
See Anansi::DatabaseComponent for details. A parent module of Anansi::Database::Oracle.
See Anansi::DatabaseComponent::autoCommit for details.
See Anansi::DatabaseComponent::bind for details.
See Anansi::DatabaseComponent::binding for details.
See Anansi::DatabaseComponent::commit for details.
See Anansi::DatabaseComponent::connect for details. Overridden by Anansi::Database::Oracle::connect.
See Anansi::DatabaseComponent::disconnect for details.
See Anansi::DatabaseComponent::finalise for details. Overrides Anansi::Class::finalise. A virtual method.
See Anansi::DatabaseComponent::finish for details.
See Anansi::DatabaseComponent::handle for details.
See Anansi::DatabaseComponent::initialise for details. Overrides Anansi::Class::initialise. A virtual method.
See Anansi::DatabaseComponent::prepare for details.
See Anansi::DatabaseComponent::rollback for details.
See Anansi::DatabaseComponent::statement for details.
See Anansi::DatabaseComponent::validate for details. Overridden by Anansi::Database::Oracle::validate.
if(Anansi::Database::Oracle::connect( $OBJECT, undef, DATABASE => 'someDatabase', PASSWORD => 'somePassword', USERNAME => 'someUser', )); if($OBJECT->connect( undef, DATABASE => 'someDatabase', PASSWORD => 'somePassword', USERNAME => 'someUser', ));
An object of this namespace.
The abstract identifier of a subroutine.
Named parameters.
Defines whether the Oracle driver automatically saves any changes made to the DATABASE. A value of 1 (one) means changes will be saved, a value of 0 (zero) means changes will need to be manually saved. Changes are not saved by default.
The name of the Oracle database. The content of the ORACLE_SID environment variable is used by default.
The IP address of the computer where the Oracle DATABASE is hosted. A value of 127.0.0.1 is used by default.
The password of the USERNAME that is accessing the Oracle database. A value of undef is used by default.
The IP address port number of the computer where the Oracle DATABASE is hosted. A value of 1521 (one five two one) is used by default.
Defines whether the Oracle driver will use the warn function. A value of 1 (one) means errors will be output using warn, a value of 0 (zero) means errors will not be output in this way. Errors are output by default.
Defines whether the Oracle driver will use the die function. A value of 1 (one) means errors will be output using die, a value of 0 (zero) means errors will not be output in this way. Errors are output by default.
The user that is accessing the Oracle database. A value of undef is used by default.
Overrides Anansi::DatabaseComponent::connect.
if(1 == Anansi::Database::Oracle::validate($OBJECT, undef)); if(1 == Anansi::Database::Oracle::channel($OBJECT, 'VALIDATE_AS_APPROPRIATE')); if(1 == Anansi::Database::Oracle->validate(undef)); if(1 == Anansi::Database::Oracle->channel('VALIDATE_AS_APPROPRIATE')); if(1 == $OBJECT->validate(undef, DRIVER => 'Oracle')); if(1 == $OBJECT->channel('VALIDATE_AS_APPROPRIATE', DRIVER => 'Oracle')); if(1 == Anansi::Database::Oracle->validate(undef, DRIVER => 'Oracle')); if(1 == Anansi::Database::Oracle->channel('VALIDATE_AS_APPROPRIATE', DRIVER => 'Oracle'));
Either an object or a string of this namespace.
When the DRIVER parameter is defined as Oracle then this database driver component will be used otherwise an attempt will be made to use this driver.
Overrides Anansi::DatabaseComponent::validate.
This module is designed to make it simple, easy and quite fast to code your design in perl. If for any reason you feel that it doesn't achieve these goals then please let me know. I am here to help. All constructive criticisms are also welcomed.
Kevin Treleaven <kevin AT treleaven DOT net>
To install Anansi::Database::Oracle, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Anansi::Database::Oracle
CPAN shell
perl -MCPAN -e shell install Anansi::Database::Oracle
For more information on module installation, please visit the detailed CPAN module installation guide.