Hello,

I am attempting to use the $dbh->tables() function to get a list of all of
the tables that I am allowed to look at. It fails!


joshua % table_list.pl
Name "main::DBI" used only once: possible typo at table_list.pl line 30.
DBD::DB2::db tables failed: [IBM][CLI Driver][DB2] SQL0104N  An unexpected
token "SCHEMA" was found following "".  Expected tokens may include:
"CURRENT DATE, TIME, TIMESTAMP, CURRENT_DATE, CURRENT_TIME, CUR".
SQLSTATE=42601

I took the code straight out of Tim's book, it looks like:


        ...
        $DSN = join ':','dbi','DB2',$dbase;

        $dbh = DBI->connect($DSN, $uid, $pw)
                 || die "Cannot connect to $DBI: $DBI::errstr\n" unless
$dbh;

               
        #
        # Get Tables
        #
        my @tables = $dbh->tables();

        foreach my $table ( @tables ) {
                print "Table: $table\n";
        }

I am using DBD::DB2 version 1.6

Thanks for the help

---
Ronald Warden
Corporate Data Manager
250.356.0466
Data Services Branch
Ministry for Children and Families


Reply via email to