Ora8HandleFree Function

Action

Deallocates the given handle of the specified type and releases all allocated resources. The handle must have been initialized with the given type.

Include file

Ora8.bdh

Syntax

Ora8HandleFree( in hHandle : number,
                in nType   : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hHandle An allocated and initialized handle that should be freed.
nType

Specifies the type of the given handle.

The specific types are:

  • OCI_HTYPE_ENV

  • OCI_HTYPE_ERROR

  • OCI_HTYPE_SVCCTX

  • OCI_HTYPE_STMT

  • OCI_HTYPE_SERVER

  • OCI_HTYPE_SESSION

  • OCI_HTYPE_TRANS

Example

var
  ghEnv0        : number;
  ghError0      : number;
  ghStmt0       : number;
  ghSvcCtx0     : number;

dcltrans
  transaction TMain
  const
    PUBLIC_KEY := "\h59b20094...";
  begin
    Ora8Init(ghEnv0, OCI_DEFAULT);
    Ora8HandleAlloc(ghEnv0, ghError0, OCI_HTYPE_ERROR);
    Ora8Logon(ghEnv0, ghSvcCtx0, "user", "password", "orclnet2");

    Ora8HandleAlloc(ghEnv0, ghStmt0, OCI_HTYPE_STMT);
    Ora8StmtPrepare(ghStmt0, sqlInsert, OCI_NTV_SYNTAX);

    Ora8Bind(ghStmt0, ":name", SQLT_CHR, 32);
    Ora8Bind(ghStmt0, ":key", SQLT_BIN, 64);

    Ora8SetString(ghStmt0, ":name", "Michael");
    Ora8SetBinary(ghStmt0, ":key",  PUBLIC_KEY, STRING_COMPLETE);

    Ora8StmtExecute(ghSvcCtx0, ghStmt0);

    Ora8HandleFree(ghStmt0, OCI_HTYPE_STMT);
    Ora8Logoff(ghSvcCtx0);
    Ora8HandleFree(ghError0, OCI_HTYPE_ERROR);
    Ora8HandleFree(ghEnv0, OCI_HTYPE_ENV);
  end TMain;

dclsql
  sqlInsert:
    INSERT INTO keys (name, key) VALUES (:name, :key);

See also

Oracle's Programmer's Guide to Oracle Call Interface for Wrapped Oracle function: OCIHandleFree