Oracle® Call Interface Programmer's Guide 11g Release 2 (11.2) E10646-13 |
|
|
PDF · Mobi · ePub |
Table 20-3 lists the maintaining context functions that are described in this section.
Table 20-3 Maintaining Context Functions
Function | Purpose |
---|---|
Remove the value stored in the context |
|
Return a unique 4-byte value each time it is called |
|
Return the value stored in the context |
|
Save a value (or address) for a particular duration |
See Also:
Oracle Database Data Cartridge Developer's Guide for more information about using these functionsRemoves the value that is stored in the context associated with the given key (by calling OCIContextSetValue()
).
The OCI environment or user session handle.
The error handle.
Unique key value.
Length of the key. Maximum is 64 bits.
The OCI environment or user session handle.
The error handle.
Unique key value.
Returns the value that is stored in the context associated with the given key (by calling OCIContextSetValue()
).
sword OCIContextGetValue( void *hndl, OCIError *err, ub1 *key, ub1 keylen, void **ctx_value );
The OCI environment or user session handle.
The error handle.
Unique key value.
Length of the key. Maximum is 64 bits.
Pointer to the value stored in the context (NULL
if no value was stored).
For ctx_value
, a pointer to a preallocated pointer for the stored context to be returned is required.
sword OCIContextSetValue( void *hndl, OCIError *err, OCIDuration duration, ub1 *key, ub1 keylen, void *ctx_value );
The OCI environment or user session handle.
The error handle.
One of these values (a previously created user duration):
OCI_DURATION_STATEMENT
OCI_DURATION_SESSION
Unique key value.
Length of the key. Maximum is 64 bits.
Pointer that is saved in the context.
The context value being stored must be allocated out of memory of duration greater than or equal to the duration being passed in. The key being passed in should be unique in this session. Trying to save a context value under the same key and duration again results in overwriting the old context value with the new one. Typically, a client allocates a structure, stores its address in the context using this call, and gets this address in a separate call using OCIContextGetValue(). The (key, value) association can be explicitly removed by calling OCIContextClearValue(), or else it goes away at the end of the duration.