|Oracle Call Interface Programmer's Guide
Release 2 (9.2)
Part Number A96584-01
OCI Navigational and Type Functions, 35 of 36
Get the most current version of an existing type by name.
sword OCITypeByName ( OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, CONST text *schema_name, ub4 s_length, CONST text *type_name, ub4 t_length, CONST text *version_name, ub4 v_length, OCIDuration pin_duration, OCITypeGetOpt get_option OCIType **tdo );
The OCI error handle. If there is an error, it is recorded in
err and this function returns OCI_ERROR. Obtain diagnostic information by calling
OCI service handle.
Name of schema associated with the type. By default, the user's schema name is used. This string must be all in upper-case, or else OCI throws an internal error and the program stops.
Length of the
schema_name parameter, in bytes.
Name of the type to get. This string must be all in upper-case, or else OCI throws an internal error and the program stops.
Length of the
type_name parameter, in bytes.
The version name is ignored and the latest version of the requested type is returned. Because type evolution is available starting in release 9.0, pre-9.0 applications attempting to access an altered type will generate an error. These applications must be modified, re-compiled, and re-linked using the new type definition.
User-readable version of the type. Pass as
(text *)0 to retrieve the most current version.
version_name in bytes.
Options for loading the types. It can be one of two values:
Pointer to the pinned type in the object cache.
This function gets a pointer to the existing type associated with schema/type name. It returns an error if any of the required parameters is null, or if the object type associated with schema/type name does not exist, or if
version_name does not exist.
Schema and type names are case-sensitive. If they have been created with SQL, you need to use strings all in upper-case, or the program will stop.
This function always makes a round-trip to the server and hence calling this function repeatedly to get the type can significantly drag down performance. To minimize the round-trips, the application may call the function for each type and cache the type objects.
To free the type obtained by this function,
OCIObjectPinCountReset() may be called.