More error diagnosis below:   

> Hello... 
>       I'm leaving aside the NULL issue for the moment... 
>       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. I wondered if 
> something was
> wrong with the 16th table, so I added 
>       if (($table ne "Table16") and ($table ne "Table17") and 
> ($table ne
> "Table18")) after the <print "$table\n";> statement, but to no avail--
> apparently the script hangs on the 16th table regardless of 
> what's in the
> table.  
>       Any suggestions to get the script to complete would be welcome. 
>       Likewise, a comprehensive treatment of Win32::ODBC would also be
> helpful-- I've found some example code on the web, but not 
> much detail.  
>       Thanks again... 
> -Chris         

If I do this:

foreach $table (@tables) {
        print "$table\n";
$db->DumpError; #ERROR HANDLING FROM WIN32::ODBC
        etc. 

        I get this from DumpError on the 15th table, which looks like a
memory problem: 
Error message: "Could not allocate enough memory (-1 bytes) for column 5.

If I do this:  
        
foreach $table (@tables) {
        print "$table\n";
if ($table ne "Table15") { #SKIP FIRST TABLE WITH MEMORY ALLOCATION PROBLEM

        etc.

        I get this message from Perl on the 18th table, which looks like a
threads problem:  
Free to wrong pool 15d2518 not 15d2500 at C:/Perl/site/lib/Win32/ODBC.pm
line 648.

        I don't see anything obviously wrong with my approach here.  Again,
any troubleshooting help would be appreciated...    
        -Chris   

-- 
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