Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi All, I am relatively new to P

Status
Not open for further replies.

HenryMonster

Programmer
Feb 21, 2002
74
US
Hi All,

I am relatively new to Perl :(

I have a Win NT 4 server running Oracle 8.1.6 database
server. I need to write a Perl program working
with this database.

Questions:

if I want to use DBI and given I currently
have just a pure installation of Perl, what should
I do next ?

Is my understanding correct that
I have to install DBI and get a DBI driver
for Oracle 8.1.6 ? If this is true, where can I get
all these components ?

Does Oracle driver for DBI
somehow rely on the standard Oracle client and local
tnsnames.ora etc. files or this driver is self
sufficient ?

If yes, how do I configure it
to connect to an Oracle instance in my NT server
as well on any other machine hosting Oracle instance ?

Thank you all in advance !




 
I suggest you pick up a copy of O'reilly's Programming the Perl DBI by Descartes and Bunce. Yes you need the DBI module. You also need the Oracle DBD (DataBase Driver). You can download both from CPAN. I don't have that much experience with Windows Perl so someone else will have to tell you how to download it. I do know that if using ActiveState Perl then you can use PPM. As far as I know the driver should be self-sufficent. When you download the modules you can read the documentation for them: perldoc DBI, perldoc DBD::Oracle. Connecting to the database is as simple as:

use DBI;

$dbh = DBI->connect("dbi:Oracle:tablename", "username", "password");

Hope this helps.
Johnny
 
Henry,

You do need the Oracle client, but if you have ActiveState's perl, and you probably do, then you already have the DBI and DBD::Oracle. Mike
"Experience is the comb that Nature gives us after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
I have been this route!

1) Install Activestate Perl
2) Run the installer for the 8.1.x client cd.
3) Install it all or at a minimum the Oracle 8 OCI
4) From a dos command line type PPM
This puts you in Perl Package Manager.
From this point you need to install DBI then
DBD::Oracle. Can't remember the syntax. Be sure
you have an internet connection so PPM can download
the modules.
5) Check out some sites on using the Perl DBI.

If you have experience with Perl/SQL the DBI is a breeze.

 
On second thought I'm not sure how well the perl on cygwin interacts with windows..... I've just used it for menial tasks. And you'll have to forgive me for the tangent this should have been a tip. [sad]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top