SYNOPSIS

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

\*(T<int odbx_result_finish\*(T> \kx \*(T<(odbx_result_t* result);\*(T>

\*(T<void odbx_result_free\*(T> \kx \*(T<(odbx_result_t* result);\*(T>

DESCRIPTION

\*(T<odbx_result_finish\*(T>() closes the result set which may also include dropping the non-fetched rows sent by the server. It releases all resources allocated by \*(T<odbx_result\*(T>() and by the native database library which are attached to \*(T<result\*(T> as well as the memory the first parameter is pointing to. Trying to free \*(T<result\*(T> manually using free() will create memory leaks because it contains more dynamically allocated structures and also the memory of the result set allocated by the native database library. \*(T<odbx_result_finish\*(T>() must be called even if the statement was not a SELECT-like statement which returned now rows as it may be necessary to commit the changes done by the statement.

\*(T<odbx_result_free\*(T>() performs the same tasks as \*(T<odbx_result_finish\*(T>() but is unable to return an error if the task couln't be completed. It shouldn't be used in applications linking to the OpenDBX library version 1.3.8 or later and it will be removed from the library at a later stage.

\*(T<result\*(T> must be valid a result set created by \*(T<odbx_result\*(T>() which is returned via its second parameter. After feeding it to \*(T<odbx_result_finish\*(T>() it becomes invalid and must not be feed to it again. Otherwise a "double free" may occur and the application may be terminated.

RETURN VALUE

\*(T<odbx_result_finish\*(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_BACKEND\*(T>

The native database library returned an error

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

The \*(T<result\*(T> parameter is invalid

RELATED TO odbx_result_finish…

\*(T<odbx_result\*(T>()