Solved

Connectivity of Perl to Oracle

Posted on 2002-05-12
1
209 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
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now