Solved

Connectivity of Perl to Oracle

Posted on 2002-05-12
1
226 Views
Last Modified: 2013-12-25
How will I connect my Oracle database to Perl?How will I run the said database with perl?Can I have an sample code for this?
0
Comment
Question by:keziah0815
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
andreif earned 100 total points
ID: 7005920
Hi,
here are some parts of my working code, hope it helps

use DBI;
$dbh = DBI->connect("DBI:Oracle:host=DB_IP_HERE;sid=ORCL;port=1521",'DB_USER_NAME_HERE','DB_PASSWORD_HERE') or die "Couldn't connect to database: ".$DBI::errstr;

$sql = "select * from mytable";
$sth=$dbh->prepare($sql) or print DBI::error;
$sth->execute or print $DBI::error;

while ($record = $sth->fetchrow_hashref) {
  print "$$record{name} - $$record{email}<br>";
}
$sth->finish;
$dbh->disconnect;
0

Featured Post

Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question