Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: absolute newbie: perl-cgi+oracle

Re: absolute newbie: perl-cgi+oracle

From: Jason Baugher <jason_at_baugher.pike.il.us>
Date: Thu, 26 Sep 2002 13:58:00 GMT
Message-ID: <Xns92955B372AD73jasonbaugherpikeilus@209.242.76.10>


Johny Tom Nishanth Alphonse <jta01_at_doc.ic.ac.uk> wrote in comp.databases.oracle.misc:

> my $dbh =
> DBI->connect('DBI:Oracle:oradb_at_localhost:1521','Nishanth','Nishanth') ||
> die("Nope. Didn't make it\n");
>

Your connect is wrong. It's also different than the other one in the working program, which is the clue. If you check perldoc DBD::Oracle, there are many different ways to connect. But, since you seem to be wanting to specify the database name, machine, and port, use something like this:

DBI->connect('DBI:Oracle:host=localhost;sid=oradb;port= 1521','Nishanth','Nishanth')

This syntax lets you get around referencing the tnsnames.ora like your working program does by just specifying the service name "oradb".

-- 
Jason Baugher 
Virtual Adept Professional Consulting Services
1406 Adams Street, Quincy, IL 62301 - (217) 221-5406
jason@baugher.pike.il.us - http://baugher.pike.il.us/virtualadept
Received on Thu Sep 26 2002 - 08:58:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US