This discussion is archived
1 Reply Latest reply: Sep 26, 2012 12:37 PM by jschellSomeoneStoleMyAlias RSS

Perl Script unable to do database call

Asif Khan Newbie
Currently Being Moderated
Hi,

Below program is doing nothing, simply hanging. Same program is running fine in other servers. All perl modules are installed.

bash-3.2$ cat test.pl
#!/usr/local/git/bin/perl -w
use strict;
use DBI;
my $db = DBI->connect("DBI:Oracle:<DB>",'<Username>','<password>') or die "Could not connect to the database pxrpam". DBI->errstr;
$db->{AutoCommit} = 0;
$db->{RaiseError} = 1;
$db->{ora_check_sql} = 0;
$db->{RowCacheSize} = 16;
my $SEL = "select count(*) from test_table";
my $sth = $db->prepare($SEL);
print "If you see this, parse phase succeeded without a problem.\n";
$sth->execute();
print "If you see this, execute phase succeeded without a problem.\n";
my $count = $db->selectrow_array ($SEL);
printf ("Count = %d\n",$count);
END {
$db->disconnect if defined($db);
}
bash-3.2$
bash-3.2$
bash-3.2$ /usr/local/git/bin/perl test.pl
*^Crl+C*

bash-3.2$

I am very new to the perl scripting. I am not having any idea how to debug this. Please help me.

Thanks in advance!

Thanks
Asif

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points