disconnect

Disconnects the database handle from the database it is connected to. With MySQL, a call to disconnect is not needed because transactions are not currently supported. However, if transactions do become supported, then you’ll need to call $database->disconnect before you exit the program, to make sure ensure all the changes have been committed to the database.

A call to disconnect before ending a program is a good idea if you want to create portable code. If there is an error disconnecting from the database, the error message gets stored in $DBI::errstr.

Example:

$db_handle->disconnect or die ("Error: $DBI::errstr\n");



Perl Database Programming
Perl Database Programming
ISBN: 0764549561
EAN: 2147483647
Year: 2001
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net