Yes, you can use DBI and DBD :: Oracle Modules .
However, there are some problems with Oracle. I remember some funny games and games with Oracle 8, so they can no longer be applied, but in some cases require the setting of ENV variables, such as ORACLE_HOME, ORACLE_BASE and ORACLE_SID.
In DBD :: Oracle, the doc goes into this, and another ENV TWO_TASK variable is also mentioned. Therefore, getting it to work may depend on ...
- which version of Oracle do you have
- do you have a listener (which i think you need for network access like CGI?)
- which version of SQL * Net is used.
It seems complicated, but all you probably need is to add these ENV variables to the web server (iPlanet is what I used at the time). As an alternative from a DBD :: Oracle document, it gives ...
BEGIN {
$ENV{ORACLE_HOME} = '/home/oracle/product/10.x.x';
$ENV{TWO_TASK} = 'DB';
}
$dbh = DBI->connect('dbi:Oracle:','scott', 'tiger');
$dbh = DBI->connect('dbi:Oracle:','scott/tiger');
PS. , CGI script , Oracle! , ENV , ( script !)...
my $db = DBI->connect("dbi:Oracle:host=$host;sid=$database", $user, $pass,
{ RaiseError => 0, PrintError => 0 } )
or croak( "Unable to connect to DB - $DBI::errstr" );
, , - TNLISTENER.CONF Oracle ( , !), , Oracle ( ).