SYNOPSIS

\*(T<#include <opendbx/api.h>\*(T>

\*(T<int odbx_unbind\*(T> \kx \*(T<(odbx_t* handle);\*(T>

DESCRIPTION

Releases the binding of the connection to the database and user associated by \*(T<odbx_bind\*(T>() to the supplied connection object. This is useful for switching to a different database or binding to the database with different credentials. It is also possible to set new connection related options before rebinding to the database server. If an open transaction exists while this function is executed in the firebird backend, it will be committed to the database and closed. The behavior of the other backends for open transactions may vary.

It's necessary to process all result sets returned by the database server before using this function. Otherwise, it might return an error depending on the native database client library and the backend module. This function must be invoked before calling \*(T<odbx_finish\*(T>() to avoid memory leaks and connections left open which may block necessary resources later on.

The \*(T<handle\*(T> parameter has to be the connection object created and returned by \*(T<odbx_init\*(T>(). It becomes invalid after it was supplied to \*(T<odbx_finish\*(T>() and \*(T<odbx_unbind\*(T>() will return an error in this case.

RETURN VALUE

\*(T<odbx_unbind\*(T>() returns \*(T<ODBX_ERR_SUCCESS\*(T>, or an error code whose value is less than zero if one of the operations couldn't be completed successfully. Possible error codes are listed in the error section and they can be feed to \*(T<odbx_error\*(T>() and \*(T<odbx_error_type\*(T>() to get further details.

ERRORS

-\*(T<ODBX_ERR_PARAM\*(T>

\*(T<handle\*(T> is NULL or the supplied connection object is invalid

RELATED TO odbx_unbind…

\*(T<odbx_bind\*(T>(), \*(T<odbx_error\*(T>(), \*(T<odbx_finish\*(T>()