Try $dbh -> disconnect;

Cheers

Mark C

> -----Original Message-----
> From: Frank Newland [mailto:[EMAIL PROTECTED]]
> Sent: 30 July 2001 16:35
> To: [EMAIL PROTECTED]
> Subject: Destroying Database Handle
> 
> 
> Question about DBI
> 
> I'm having success in preparing , executing and getting SQL 
> output when I
> use DBI.
> What I want to do is ensure that I close properly. 
> Q: What statement(s) do I need to prevent destroying database handle?
> 
> Thanks,
> 
> Frank
> ***************************
> #!/usr/bin/perl -w 
> use strict ;
> use DBI;
> my $dbh ; my $sth ; my $sql_stmt ; $data_row; 
> 
> $dbh = DBI->connect("dbi:Oracle:oracle:qa_1",user, 
> password,{PrintError =>0,
> AutoCommit =>0 )) || die "failed to login to Oracle \n";
> $sql_stmt = << "EOF+" ;
> select comments from table_a where comments is not null
> EOF+ 
> 
> $sth=$dbh->prepare($sql_stmt) || die "Failure to prepare SQL 
> Statement \n" ;
> $sth->execute || die "Failure to execute SQL \n";
> $data_row=$sth->fetchrow_hashref;
> $comments = $data_row->{COMMENTS};
> 
> print $comments ;
> ******************************************
> Output:
> 185221202202110  ## desired output. .
> Database handle destroyed without explicit disconnect.
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to