The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Access to database/eval command chriss_58 Shell Programming and Scripting 1 06-09-2008 01:05 AM
Help with ms access database and firebird ncatdesigner UNIX for Advanced & Expert Users 0 05-14-2008 07:05 AM
Perl Database access mercuryshipzz Shell Programming and Scripting 2 01-15-2008 10:54 PM
C program with Oracle database access kavi High Level Programming 5 07-12-2002 12:48 AM
microsoft access database on Unix spiderling UNIX for Dummies Questions & Answers 1 03-07-2002 03:43 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-12-2008
Registered User
 

Join Date: May 2008
Posts: 31
problem trying to access a database

hi guys,

I am using the following code in order to access a database.

#!/usr/bin/perl

print "READ DATA FROM DATABASE\n";

use DBI;
use strict;
#use DBD::Oracle;


my $user='reassure';
my $pass='R3Assur3';
#my $dsn="dbi:Oraclercl";
my $dsn='dbi:Oracle:cobscs.world';
my $dbh = '';
my $sth='';
my @row= '';
my $answa='';
my $answt='';
my $name="ddd03ed";
my $sql="";
my $sth="";
my $dbh="";

#$ENV{ORACLE_HOME} = "/home/oracle/product/9.2.0.1.0"

eval
{

print "connect to database";
$dbh = DBI->connect($dsn, $user, $pass);
print "connected to database\n";
$sql = qq{ SELECT * FROM rtx_test };
#my $sql = "SELECT name from christos1";
#my $sql = qq{ SELECT * FROM cc_test_cases};
print("HELLO\n");

$sth = $dbh->prepare( $sql );
$sth->execute( );
};

if ($@) {
print "An error occurred ($@), continuing\n";

}


#$sth = $dbh->prepare($sql);^M
#$sth->execute($answa, $answt);^M
print("HELLO1\n");
while(@row = $sth->fetchrow_array()) { ^M
print "$row[0]: $row[1]\n"; ^M
}

print("HELLO2\n");


#while ( my(@helloWorldString) = $sth->fetchrow_array) {

#print @helloWorldString, "\n";
#}

$dbh->disconnect( ); # Disconnect
#};


when i am trying to run the script i get the following error.
connect to databaseAn error occurred (install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@INC contains: /opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-thread-multi /opt/perl_32/lib/5.8.8 /opt/perl_32/lib/site_perl/5.8.8/IA64.ARCHREV_0-thread-multi /opt/perl_32/lib/site_perl/5.8.8 /opt/perl_32/lib/site_perl /opt/perl_32/lib/vendor_perl/5.8.8/IA64.ARCHREV_0-thread-multi /opt/perl_32/lib/vendor_perl/5.8.8 /opt/perl_32/lib/vendor_perl .) at (eval 4) line 3.
Perhaps the DBD::Oracle perl module hasn't been fully installed,
or perhaps the capitalisation of 'Oracle' isn't right.
Available drivers: DBM, ExampleP, File, Proxy, Sponge.



One more thing.
I can find this Oracle.pm under the following directory

/oracle/product/10.2.0.2/perl/lib/site_perl/5.8.3/IA64.ARCHREV_0-thread-multi-LP64/DBD/Oracle.pm




Any idea why this happens??

Thank you

Last edited by chriss_58; 06-12-2008 at 02:44 AM.
Reply With Quote
Forum Sponsor
  #2  
Old 06-12-2008
Registered User
 

Join Date: May 2008
Posts: 31
One more thing.
I can find this Oracle.pm under the following directory

/oracle/product/10.2.0.2/perl/lib/site_perl/5.8.3/IA64.ARCHREV_0-thread-multi-LP64/DBD/Oracle.pm
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0