Solved

Connectivity of Perl to Oracle

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need some help with powershell script 5 64
Powercli + List all VM's Per SCSILUN 15 135
Batch File- Finding Drive Description 11 53
Powershell PGP and SFTP 1 45
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

737 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