> -----Original Message-----
> From: Michael A. Chase [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 2001 6:21 PM
> To: 'RICHARD A. NAKROSHIS (Contractor) '; 'DBI User's Mailing List '
> Cc: Sterin, Ilya
> Subject: Re: Error on ->disconnect?
>
>
> This is a problem that happens in Win32 if you reach global
> destruction with
Yes I remember that, but I believe it had a different error, something
regarding an disconnecting while there are still active handles? This
message is stating that it's trying to call execute on a undefined handle.
I still believe it's the finish call, take a look at his code, I left out
irrelevant stuff...
while (my $queryname = <>) {
$sth->execute(uc($queryname))
or die "Couldn't execute statement: " . $sth->errstr;
# Read the matching records and print them out
while (@data = $sth->fetchrow_array()) {
my $pn_id = $data[0];
my $last_name = $data[1];
my $first_name = $data[2];
my $middle_name = $data[3];
print "\t$pn_id: $first_name $middle_name $last_name\n";
}
if ($sth->rows == 0) { print "No names matched
'$queryname'.\n\n"; }
$sth->finish;
### This will finish and disallocate the $sth handle, so when this loops
again it will try to call execute on it, but it's no longer valid???? Am I
getting this correct. I believe this is what finish does, is disallocates
the resources for that handle.
print "\nEnter name> ";
}
Ilya
> a database handle still defined even though it is not open.
> Assign undef to
> $dbh after you call $dbh->disconnect to cause it to be deallocated before
> global destruction.
>
> $sth->finish is unnecessary and is strongly not recommended in this case,
> but it shouldn't do any active harm.
> --
> Mac :})
> ** I normally forward private questions to the appropriate mail list. **
> Give a hobbit a fish and he eats fish for a day.
> Give a hobbit a ring and he eats fish for an age.
> ----- Original Message -----
> From: "Sterin, Ilya" <[EMAIL PROTECTED]>
> To: "'RICHARD A. NAKROSHIS (Contractor) '"
> <[EMAIL PROTECTED]>;
> "'DBI User's Mailing List '" <[EMAIL PROTECTED]>
> Sent: Thursday, July 12, 2001 13:29
> Subject: RE: Error on ->disconnect?
>
>
> > That has nothing to do with you disconnect. You are not using finish()
> > properly, which in your case should not be used at all. You
> are actually
> > disallocating the handle which you prepared and on the second
> while() run,
> > there is nothing to execute.
> >
> > See documentation on finish().
> >
> > -----Original Message-----
> > From: RICHARD A. NAKROSHIS (Contractor)
> > To: DBI User's Mailing List
> > Sent: 7/12/01 2:23 PM
> > Subject: Error on ->disconnect?
> >
> > I'm new to DBI programming, and get an error on exiting my program,
> > which does query the database and return values. The problem seems to
> > be with the line $rc = $dbh->disconnect, which does not appear to be
> > executed. Can anyone point out what I'm doing wrong?
> >
> > Rick
> >
> > (begin error messages)
> >
> > (in cleanup) Uncaught exception from user code:
> > Can't call method "FETCH" on an undefined value at
> > C:/Perl/site/lib/Win32/TieRegistry.pm line 1486, <> line 4 during global
> > destruction.
> > Win32::TieRegistry::DESTROY('Win32::TieRegistry=HASH(0x22292a0)') called
> > at ora-test.pl line 0
> > eval {...} called at ora-test.pl line 0
>