Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBI-Modul and Oracle 9i

411268Dec 26 2003 — edited Dec 26 2003
Hello,

I can't connect to an Oracle database. I tried several handler I got from CPAN (see script)!

Thank you

-----------------

Perl script:

use DBI;
use DBD::Oracle;

$user = "scott";
$passwd = "tiger";


#Which DB handler is better and how do I have to change them

#to make them work with an Oracle 9i database? I tried several ways but nothing worked!

# The value of ORACLE_HOME is C:\oracle\ora92

#$dbh = DBI->connect("dbi:Oracle:host=machine-0560nntbn1;sid=oracle", $user, $passwd);

#$dbh = DBI->connect('dbi:Oracle:host=machine-0560nntbn1;sid=oracle;port=1521', 'scott/tiger', '');

BEGIN {
$ENV{ORACLE_HOME} = '/home/oracle/product/7.x.x';
$ENV{TWO_TASK} = 'DB';
}
$dbh = DBI->connect('dbi:Oracle:','scott', 'tiger');


$sth = $dbh->prepare("CREATE TABLE names (id INTEGER, sname VARCHAR(20), fname VARCHAR(20))");

$sth->execute();

$sth->finish;
$dbh->disconnect;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 23 2004
Added on Dec 26 2003
2 comments
109 views