Ora8ServerAttach Function

Action

Creates an access path to a data source for OCI operations.

Include file

Ora8.bdh

Syntax

Ora8ServerAttach( in hServer : number,
                  in sServer : string,
                  in nMode   : number optional ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hServer An uninitialized server handle, which gets initialized by this call.
sServer SQL*Net connect descriptor.
nMode

Specifies the various modes of operation.

The valid modes are:

  • OCI_DEFAULT (default)

  • OCI_CPOOL

Example

var
  ghEnv0        : number;
  ghError0      : number;
  ghServer0     : number;

dcltrans
  transaction TMain
  begin
    Ora8Init(ghEnv0);
    Ora8HandleAlloc(ghEnv0, ghError0, OCI_HTYPE_ERROR);
    Ora8HandleAlloc(ghEnv0, ghServer0, OCI_HTYPE_SERVER);
    Ora8ServerAttach(ghServer0, "ORCLNET2");

    ...

    Ora8ServerDetach(ghServer0);
    Ora8HandleFree(ghServer0, OCI_HTYPE_SERVER);
    Ora8HandleFree(ghError0, OCI_HTYPE_ERROR);
    Ora8HandleFree(ghEnv0, OCI_HTYPE_ENV);
  end TMain;

See Also

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