> Hello... 
>       I'm leaving aside the NULL issue for the moment... 

Is that wise ? :-)

>       Today's project is to get a complete list of column 
> names for each
> table in the database, and the value for the first record 
> (row) in each
> table.  This code does the right thing for 15 tables and then 
> hangs and
> quits without an error message on the 16th table:  
> ****************************************************
> use warnings;
> use Win32::ODBC; 
> my (@tables) = $db->TableList;
> foreach $table (@tables) {
>       print "$table\n";
>                       $db->Sql ("SELECT * FROM $table");
>                       $db->FetchRow();
>                       my %hash = $db->DataHash;
>                       foreach $key (sort(keys %hash)) {
>                               print "\t$key", '=',$hash{$key}, "\n";
>                               } #end foreach
>       }
> *******************************************************
> 
>       On the 16th table, the <print "$table\n";> line executes and the
> script hangs and quits after a few seconds.

Define 'quits'.  Does it 'die'?  An error?  What is the $? value (oh
sorry, 
you are in windows).   

Insert the following in your code:
-----------------
sub err_exit {
        print "Program Terminated with rc=$?".$/;
        print "Last error was $@".$/ if $@;
}
$SIG{__DIE__} = \&err_exit;
END{
        err_exit();
}
-----------------
to catch the error code on the way out.  Consider printing $? $! $@ and
$^E (I think?)
to get all possible error permutations.

Also consider perl -d <script> and run it in trace mode.
Again, consider 'use diagnostics' and see if that helps.

To be honest, it sounds like PERL is dumping due to an error in the ODBC
module, so check the Windows EVENTVIEWER as well.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to