Skip to content

Latest commit

 

History

History
21 lines (19 loc) · 1.32 KB

freeing-descriptors.md

File metadata and controls

21 lines (19 loc) · 1.32 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Freeing Descriptors
Freeing Descriptors
David-Engel
davidengel
01/19/2017
sql
connectivity
conceptual
SQLFreeHandle function [ODBC]
descriptors [ODBC], allocating and freeing
freeing descriptors [ODBC]
allocating and freeing descriptors [ODBC]

Freeing Descriptors

Explicitly allocated descriptors can be freed either explicitly, by calling SQLFreeHandle with HandleType of SQL_HANDLE_DESC, or implicitly, when the connection handle is freed. When an explicitly allocated descriptor is freed, all statement handles to which the freed descriptor applied automatically revert to the descriptors implicitly allocated for them.

Implicitly allocated descriptors can be freed only by calling SQLDisconnect, which drops any statements or descriptors open on the connection, or by calling SQLFreeHandle with a HandleType of SQL_HANDLE_STMT to free a statement handle and all the implicitly allocated descriptors associated with the statement. An implicitly allocated descriptor cannot be freed by calling SQLFreeHandle with a HandleType of SQL_HANDLE_DESC.

Even when freed, an implicitly allocated descriptor remains valid, and SQLGetDescField can be called on its fields.