Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: absolute newbie: perl-cgi+oracle
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/virtualadeptReceived on Thu Sep 26 2002 - 08:58:00 CDT
![]() |
![]() |