Hitachi

Hitachi Advanced Database Application Development Guide


16.12.2 SQLFreeHandle

Organization of this subsection

(1) Function

This ODBC function releases resources associated with a specific environment, connection, statement, or descriptor handle.

(2) Format

SQLRETURN SQLFreeHandle
(
  SQLSMALLINT     HandleType,        /* In */
  SQLHANDLE       Handle             /* In */
)

(3) Arguments

HandleType

Specifies one of the following handle types:

  • SQL_HANDLE_ENV: Environment handle

  • SQL_HANDLE_DBC: Connection handle

  • SQL_HANDLE_STMT: Statement handle

  • SQL_HANDLE_DESC: Descriptor handle

Handle

Specifies the handle to be released.

Specify a value that was output by *OutputHandlePtr of SQLAllocHandle before this function is executed.

(4) Return value

This ODBC function returns SQL_SUCCESS, SQL_ERROR, or SQL_INVALID_HANDLE.

(5) SQLSTATE

This ODBC function returns one of the following SQLSTATE values:

SQLSTATE

Description

Remarks

Return

01000

General warning

--

N

HY001

Memory allocation error

N

HY010

Function sequence error

  • Not all subsidiary handles and other resources, including connections, have been released yet.

  • HandleType is SQL_HANDLE_STMT, but the asynchronous execution function for that statement handle has not terminated.

Y

HY013

Memory management error

--

N

HY017

Invalid use of an automatically allocated descriptor handle

N

HY092

Invalid attribute or option identifier

An invalid value was specified for HandleType.

Y

HYT01

Connection timeout expired

--

N

IM001

Driver does not support this function

N

Legend:

Y: This SQLSTATE might be returned by the HADB ODBC driver.

N: This SQLSTATE is not returned by the HADB ODBC driver.

--: None