The snippet below used to run, but now fails doing a prepare of 'select
count(*) from sysibm.systables'.
The only known difference is an upgrade from DB2 V7 to V8.  The DBA
insists that plans have been bound as public so security should not be a
problem.  Any idea what the problem could be or what to try to help me
identify it? 
UPDATED to include:
The DBI and DBD modules have not been reinstalled (make, make test, make
install) since the upgrade, should they have been?  Is that the problem?
TIA, Paula
The environment is AIX 4.3.3 running Perl 5.00503
DBI (version 1.35) found in /usr/opt/perl5/lib/site_perl/5.005/aix
DBD::DB2 (version 0.76) found in /usr/opt/perl5/lib/site_perl/5.005/aix
DBD::DB2::Constants (version 0.20) found in
/usr/opt/perl5/lib/site_perl/5.005/aix
--snippet
use strict;
use DBI;
use DBD::DB2::Constants;
use DBD::DB2;
my $numParms = scalar(@ARGV);
my $user;
my $pass;
my $tier;
if ($numParms > 2) {
    $user = $ARGV[0];
    $pass = $ARGV[1];
    $tier = $ARGV[2];
}else{
    print "U need to pass userid,password and tier values at
execution!!\n";
    exit(16);
}    
my $dbh = DBI->connect("dbi:DB2:IW_$tier","$user","$pass");
if (!defined($dbh)) {
    print "Connection failed\n";
    exit(12);
}else{
    print "Connection successful\n";
}
my $stmt = 'select count(*) from sysibm.systables ';
print "Preparing statement:\n\t$stmt\n";
my $sth = $dbh->prepare($stmt) or die "DYING:PrepareFailed
$DBI::errstr"; 
if (!defined($sth)) {
    print "Prepare failed\n";
    exit(12);
}else{
    print "\$sth exists: $sth\n";
}
$sth->execute() or die "DYING:Execute failed $DBI::errstr";
while (my @data = $sth->fetchrow()) {
        print "\tQuery returned: @data\n";
        }
$sth->finish;                      
$dbh->disconnect;
print "Processing Successful\n";
exit(0);
--end snippent
--results
Connection successful
Preparing statement:
        select count(*) from sysibm.systables
DBD::DB2::db prepare failed: [IBM][CLI Driver][DB2/6000] SQL0551N
"PJC002" does
 not have the privilege to perform operation "EXECUTE" on object
"NULLID.SYSSH20
0".  SQLSTATE=42501
$sth exists: DBI::st=HASH(0x201564a0)
DBD::DB2::st execute failed: [IBM][CLI Driver][DB2/6000] SQL0551N
"PJC002" does
 not have the privilege to perform operation "EXECUTE" on object
"NULLID.SYSSH20
0".  SQLSTATE=42501
DYING:Execute failed [IBM][CLI Driver][DB2/6000] SQL0551N  "PJC002" does
not hav
e the privilege to perform operation "EXECUTE" on object
"NULLID.SYSSH200".  SQL
STATE=42501
--end results 

Reply via email to