Oracle 8i Data Cartridge Developer's Guide Release 2 (8.1.6) Part Number A76937-01 |
|
Reference: Cartridge Services Using C, 4 of 6
This call is used to save a value (or address) for a particular duration.
sword OCIContextSetValue( dvoid *hndl, OCIError *err, OCIDuration duration, ub1 *key, ub1 keylen, dvoid *ctx_value);
The OCI environment or user session handle.
The error handle.
One of the following (a previously created user duration):
OCI_DURATION_STATEMENT
OCI_DURATION_SESSION
Unique key value.
Length of the key. Maximum is 64 bits.
Pointer that will be 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 will result in overwriting the old context value with the new one. Typically, a client will allocate a structure, store its address in the context using this call, and get this address in a separate call using OCIContextGetValue(). The (key, value) association can be explicitly removed by calling OCIContextClearValue() or else it will go away at the end of the duration.
Table 13-12 OCIContextSetValue Keywords/Parameters
This call is used to return the value that is stored in the context associated with the given key (by calling OCIContextSetValue()).
sword OCIContextGetValue( dvoid *hndl, OCIError *err, ub1 *key, ub1 keylen, dvoid **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.
Table 13-13 OCIContextSetValue Keywords/Parameters
This call is used to remove the value that is stored in the context associated with the given key (by calling OCIContextSetValue()).
sword OCIContextClearValue( dvoid *hndl, OCIError *err, ub1 *key, ub1 keylen);
The OCI environment or user session handle.
The error handle.
Unique key value.
Length of the key. Maximum is 64 bits.
An error is returned when a non-existent key is passed.
Table 13-14 OCIContextClearValue Keywords/Parameters
Keyword/Parameter | Meaning |
---|---|
|
the |
|
the error handle |
|
unique key value |
|
length of the above key (maximum length is 64 bits) |
This call will return a unique, 4-byte value each time it is called.
sword OCIContextGenerateKey( dvoid *hndl, OCIError *err, ub4 *key);
The OCI environment or user session handle.
The error handle.
Unique key value.
Length of the key. Maximum is 64 bits.
This value is going to be unique on a per session basis.
Table 13-15 OCIContextGenerateKey Keywords/Parameters
Keyword/Parameter | Meaning |
---|---|
|
the |
|
the error handle |
|
pointer to a unique, 4 byte value |
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|