Hi,
I am connecting to oracle database using perl.
I am able to connect but i am not able to get all the rows from the table.
Here is the code.
#!/usr/bin/perl
use DBI;
my $dbh=DBI->connect("DBI:Oracle:student","class","welcome") or die "Couldnot connect oracle Database";
$sth=$dbh->prepare("select * from dummy")or die "cannot prepare the selected statement";
$sth->execute() or die "cannot execute the statement";
print "entered\n";
my @row;
while (@row = $sth->fetchrow_array) { # retrieve one row
print join(", ", @row), "\n";
}
Here is the table structure in Oracle.
SQL> describe dummy;
Name Null? Type
----------------------------------------- -------- ----------------------------
NAME VARCHAR2(10)
SQL> select * from dummy;
NAME
----------
aaa
eee
I am not able to get the output. The output should be:
aaa eee
How can i get the above output in perl?
Help is very much appreciated.
Regards