This is my code.
<code>
#! C:\Perl\bin\perl.exe -w
use strict;
use DBI;
use CGI qw(:standard);
use CGI::Carp ;
use CGI::Carp 'fatalsToBrowser' ;
print header;
print start_html('IDS');
my $dbh = DBI->connect( 'dbi:Oracle:ilclpdv3',
'rbhute',
'rbhute',
{
RaiseError => 1,
AutoCommit => 0
}
) || die "Database connection not made: $DBI::errstr";
print p('Connected');
my $sth = $dbh->prepare("select table_name from user_tables");
$sth->execute();
while (my ($table_name) = $sth->fetchrow_array()) {
print p("$table_name");
}
$sth->finish();
print p('Disconnected');
$dbh->disconnect();
</code>
It gives the following output.
<output>
Connected
T_IDS_JOBS
T_IDS_APP
T_IDS_CLNT_DIV
T_IDS_MST_CLNT
T_IDS_MST_USR
Disconnected
<end of output>
Whih is correct. However, when I change the query to read any of the
tables, it shows just "Connected" and "Disconnected".
Any idea of where I'm going wrong?
--
Rohit V. Bhute
http://blog.rvbhute.org/