DBD-SQLAnywhere

 view release on metacpan or  search on metacpan

SQLAnywhere.pm  view on Meta::CPAN

    sub ping {
	my( $dbh ) = @_;

	# Doing a prepare() will actually talk to the server and so this
	# is a cheap test.
	# Strictly speaking, the prepare() could fail due to an error
	# reported from the server (eg. if we exceed the prepared statement
	# limit) but we don't have access to the ping facility through DBCAPI
	# so this is usually a valid test.
	my $rv = eval { $dbh->prepare( "select 1" ); };
	my $alive = ( defined( $rv ) ? 1 : 0 );

	# Suppress the error for ping() -- it should just return a boolean without reporting error
	$dbh->set_err( undef, undef );

	return( $alive );
    }


# Use the DBI-provided quote routine
#    sub quote {
#	my($dbh, $value) = @_;
#	return $value;
#    }




( run in 0.908 second using v1.01-cache-2.11-cpan-39bf76dae61 )