Oracle Call Interface Programmer's Guide, Volumes 1 & 2 Release 8.0 A58234-01 |
|
This Appendix describes attributes for OCI handles and descriptors, which can be read with OCIAttrGet(), and can be modified with OCIAttrSet().
The following handle types are included:
For each handle type, the attributes which can be read or changed are listed.
Each attribute listing includes the following information:
The following modes are possible:
READ - the attribute can be read using OCIAttrGet()
WRITE - the attribute can be modified using OCIAttrSet()
READ/WRITE - the attribute can be read using OCIAttrGet(), and it can be modified using OCIAttrSet().
DescriptionThis is a description of the purpose of the attribute.
This is the datatype of the attribute. If necessary, a distinction is made between the datatype for READ and WRITE modes.
In some cases, only certain values are allowed, and they are listed here.
In some cases an example is included.
READ/WRITE
Sets the maximum size (high watermark) for the client-side object cache as a percentage of the optimal size. The default value is 10%. See the section "Object Cache Parameters" on page 11-5 for more information.
ub4 *
READ/WRITE
Sets the optimal size for the client-side object cache in bytes. The default value is 200k bytes. See the section "Object Cache Parameters" on page 11-5 for more information.
ub4 *
READ
Returns TRUE if the environment was initialized in object mode.
boolean *
READ
Returns the function code of the last OCI operation on a handle. Each OCI function has a ub4 value.
The OCI function codes are listed in Table B-1 on page B - 5.
ub4 *
READ/WRITE
This attribute sets the value of OCI_PIN_DEFAULT for the application associated with the environment handle.
For example, if OCI_ATTR_PINOPTION is set to OCI_PIN_RECENT, then if OCIObjectPin() is called with the pin_option parameter set to OCI_PIN_DEFAULT, then the object is pinned in OCI_PIN_RECENT mode.
OCIPinOpt *
READ/WRITE
This attribute sets the value of OCI_DURATION_DEFAULT for allocation durations for the application associated with the environment handle.
OCIDuration *
Table B-1 OCI Function Codes
READ/WRITE
This attribute sets the value of OCI_DURATION_DEFAULT for pin durations for the application associated with the environment handle.
OCIDuration *
READ
Returns the code of the last SQL command processed on the service context handle. Each SQL command has a ub4 value.
The SQL command codes are listed in Table B-2 on page B - 8.
ub2 *
READ
returns the environment context associated with the service context.
OCIEnv **
READ/WRITE
When read, returns the pointer to the server context attribute of the service context.
When changed, sets the server context attribute of the service context.
OCIServer ** (READ) / OCIServer * (WRITE)
READ/WRITE
When read, returns the pointer to the authentication context attribute of the service context.
When changed, sets the authentication context attribute of the service context.
OCISession ** (READ) / OCISession * (WRITE)
READ/WRITE
When read, returns the pointer to the transaction context attribute of the service context.
When changed, sets the transaction context attribute of the service context.
OCITrans ** (READ) / OCITrans * (WRITE)
READ
Allows you to determine whether an application has switched to Oracle7 mode (e.g., through an OCISvcCtxToLda() call). A non-zero (true) return value indicates that the application is currently running in Oracle8 mode, a zero (false) return value indicates that the application is currently running in Oracle7 mode.
ub1 *
The following code sample shows how this parameter might be used:
in_v8_mode = 0; OCIAttrGet ((dvoid *)svchp, (ub4)OCI_HTYPE_SVCCTX, (ub1 *)&in_v8_mode, (ub4) 0, OCI_ATTR_IN_V8_MODE, errhp); if (in_v8_mode) fprintf (stdout, "In V8 mode\n"); else fprintf (stdout, "In V7 mode\n");
READ
Returns the environment context associated with the server context.
OCIEnv **
READ
Returns the function code of the last OCI operation on a handle. Each OCI function has a ub4 value.
The OCI function codes are listed in Table B-1 on page B-5.
ub4 *
READ/WRITE
The external name is the user-friendly global name stored in sys.props$.value$ where name = `GLOBAL_DB_NAME'. It is not guaranteed to be unique unless all databases register their names with a network directory service.
Database names can be exchanged with the server in case of distributed transaction coordination. Server database names can only be accessed if the database is open at the time the OCISessionBegin() call is issued.
text ** (READ) / text * (WRITE)
READ/WRITE
Sets the client database name that will be recorded when performing global transactions. The name can be used by the DBA to track transactions that may be pending in a prepared state due to failures.
text ** (READ) / text * (WRITE)
READ
Allows you to determine whether an application has switched to Oracle7 mode (e.g., through an OCISvcCtxToLda() call). A non-zero (true) return value indicates that the application is currently running in Oracle8 mode, a zero (false) return value indicates that the application is currently running in Oracle7 mode.
ub1 *
READ/WRITE
See "Application Failover Callbacks" on page 7-36 for more information.
OCIFocbkStruct *
WRITE
Specifies a username to use for authentication.
text *
WRITE
Specifies a password to use for authentication.
text *
READ/WRITE
Can be used to establish or read a text string which identifies a transaction. This is an alternative to using the XID to identify the transaction. The text string can be up to 64 bytes long.
text ** (READ) / text * (WRITE)
READ/WRITE
Can set or read an XID which identifies a transaction.
XID ** (READ) / XID * (WRITE)
READ
Returns the function code of the last OCI operation on a handle. Each OCI function has a ub4 value. The OCI function codes are listed in Table B-1 on page B-5.
ub4 *
READ
Returns the number of rows processed so far. The default value is 1.
ub4 *
READ
Returns the function code of the SQL command associated with the statement.
ub2 *
The SQL command codes are listed in Table B-2 on page B - 8.
READ
Returns the environment context associated with the statement.
OCIEnv **
READ
The type of statement associated with the handle. Possible values are:
ub2 *
READ
Returns the rowid of the current row inserted, updated or fetched in a character string format. If execute had been a multiple row operation then, len should contain the iteration number of the row the application is interested in. When connected to an Oracle7 Server only the rowid of the last row inserted, updated, or fetched can be obtained.
OCIRowid **
READ
This attribute can be used to get the number of columns in the select-list for the statement associated with the statement handle.
ub4 *
The following code sample shows how this attribute might be used:
/* Describe of a select-list */ text *selstmt = "SELECT * FROM EMP"; ub4 parmcnt; OCIParam *parmdp; err = OCIStmtPrepare (stmhp, errhp, selstmt, (ub4)strlen((char *)selstmt), (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT); err = OCIStmtExecute (svchp, stmhp, errhp, (ub4)1, (ub4)0, (const OCISnapshot*) 0, (OCISnapshot*)0, OCI_DESCRIBE_ONLY); /* get the number of columns in the select list */ err = OCIAttrGet ((dvoid *)stmhp, (ub4)OCI_HTYPE_STMT, (dvoid *) &parmcnt, (ub4 *) 0, (ub4)OCI_ATTR_PARAM_COUNT, errhp); /* get describe information for each column */ for (i = 0; i < parmcnt; i++) { OCIParamGet (dvoid *)stmhp, OCI_HTYPE_STMT, errhp, &parmdp, i); /* get the attributes for each column */ }
WRITE
Sets the number of top level rows to be prefetched. The default value is 1 row.
ub4 *
WRITE
Sets the memory level for top level rows to be prefetched. Rows up to the specified top level row count are fetched if it occupies no more than the specified memory usage limit. The default value is 0, which means that memory size is not included in computing the number of rows to prefetch.
ub4 *
READ
Returns the function code of the last OCI operation on a handle. Each OCI function has a ub4 value. The OCI function codes are listed in Table B-1 on page B-5.
ub4 *
WRITE
See "Character Count Attribute" on page 5-26.
ub4 *
READ/WRITE
Character set ID of the bind handle.
ub2 *
READ/WRITE
Character set form of the bind handle.
ub1 *
READ/WRITE
See "OCI_ATTR_MAXDATA_SIZE Attribute" on page 5-26.
sb4 *
WRITE
Sets the number of digits to the right of the decimal point for fields where the data type is SQLT_PDN.
ub2 *
WRITE
Specifies a format string.
text **
READ
This attribute returns the number of rows that are going to be returned in the current iteration when we are in the OUT callback function for binding a DML statement with RETURNING clause.
ub4 *
READ
Returns the function code of the last OCI operation on a handle. Each OCI function has a ub4 value.
The OCI function codes are listed in Table B-1 on page B-5.
ub4 *
WRITE
Sets the number of characters in a character type data. This specifies the number of characters desired in the define buffer. The define buffer length as specified in the define call must be greater than number of characters.
ub4 *
READ/WRITE
The character set ID of the define handle.
ub2 *
READ/WRITE
The character set form of the define handle.
ub1 *
WRITE
Sets the number of digits to the right of the decimal point for fields where the data type is SQLT_PDN.
ub2 *
WRITE
Specifies a format string.
text **
READ
Returns the number of parameters in the describe handle. When the describe handle is a description of the select list, this refers to the number of columns in the select list.
ub4 *
For a detailed list of parameter descriptor attributes, refer to Chapter 6, "Describing Schema Metadata".
WRITE
Sets the internal LOB locator to empty. The locator can then be used as a bind variable for an INSERT or UPDATE statement to initialize the LOB to empty. Once the LOB is empty, OCILobWrite() can be called to populate the LOB with data. This attribute is only valid for internal LOBs (i.e., BLOB, CLOB, NCLOB).
Applications should pass address of a ub4 which has a value of 0; e.g., declare
ub4 lobEmpty = 0
then pass address &lobEmpty
.
ub4 *
For information about complex object retrieval, see "Complex Object Retrieval" on page 8-21.
WRITE
The depth level for complex object retrieval.
ub4 *
WRITE
Whether to fetch collection attributes in an object type out-of-line.
ub1 *
WRITE
A type of REF to follow for complex object retrieval.
dvoid *
WRITE
Depth level for following REFs of type OCI_ATTR_COMPLEXOBJECT_COMP_TYPE
.
ub4 *
For more information about Advanced Queueing, properties, and options, refer to the Advanced Queueing chapter of the Oracle8 Application Developer's Guide.
The following attributes are properties of the OCIAQEnqOptions descriptor:
READ/WRITE
Specifies the message identifier of the message which is referenced in the sequence deviation operation. This value is valid if and only if OCI_ENQ_BEFORE is specified in OCI_ATTR_SEQUENCE_DIVISION. This value is ignored if the sequence deviation is not specified.
OCIRaw *
READ/WRITE
Specifies whether the message being enqueued should be dequeued before other message(s) already in the queue.
ub4
The only valid values are:
READ/WRITE
Specifies the transactional behavior of the enqueue request.
ub4
The only valid values are:
The following attributes are properties of the OCIAQDeqOptions descriptor:
READ/WRITE
Name of the consumer. Only those messages matching the consumer name are accessed. If a queue is not set up for multiple consumers, this field should be set to NULL
.
text *
READ/WRITE
Specifies the correlation identifier of the message to be dequeued. Special pattern matching characters, such as the percent sign (%) and the underscore (_) can be used. If more than one message satisfies the pattern, the order of dequeuing is undetermined.
text *
READ/WRITE
Specifies the locking behavior associated with the dequeue.
ub4
The only valid values are:
READ/WRITE
Specifies the message identifier of the message to be dequeued.
OCIRaw *
READ/WRITE
Specifies the position of the message that will be retrieved. First, the position is determined. Second, the search criterion is applied. Finally, the message is retrieved.
ub4
The only valid values are:
READ/WRITE
Specifies whether the new message is dequeued as part of the current transaction.The visibility parameter is ignored when using the BROWSE
mode.
ub4
The only valid values are:
READ/WRITE
Specifies the wait time if there is currently no message available which matches the search criteria. This parameter is ignored if messages in the same group are being dequeued.
ub4
Any ub4 value is valid, but the following predefined constants are provided:
The following attributes are properties of the OCIAQMsgProperties descriptor:
READ
Specifies the number of attempts that have been made to dequeue the message. This parameter cannot be set at enqueue time.
sb4
Any sb4 value is valid.
READ/WRITE
Specifies the identification supplied by the producer for a message at enqueuing.
text *
Any string up to 128 bytes is valid.
READ/WRITE
Specifies the number of seconds to delay the enqueued message. The delay represents the number of seconds after which a message is available for dequeuing. Dequeuing by msgid overrides the delay specification. A message enqueued with delay set will be in the WAITING
state, when the delay expires the messages goes to the READY
state. DELAY
processing requires the queue monitor to be started. Note that delay is set by the producer who enqueues the message.
sb4
Any sb4 value is valid, but the following predefined constant is available:
READ
Specifies the time the message was enqueued. This value is determined by the system and cannot be set by the user.
OCIDate
READ/WRITE
Specifies the name of the queue to which the message is moved to if it cannot be processed successfully. Messages are moved in two cases: If the number of unsuccessful dequeue attempts has exceeded max_retries; or if the message has expired. All messages in the exception queue are in the EXPIRED
state.
The default is the exception queue associated with the queue table. If the exception queue specified does not exist at the time of the move the message will be moved to the default exception queue associated with the queue table and a warning will be logged in the alert file. If the default exception queue is used, the parameter will return a NULL
value at dequeue time.
This attribute must refer to a valid queue name.
text *
READ/WRITE
Specifies the expiration of the message. It determines, in seconds, the duration the message is available for dequeuing. This parameter is an offset from the delay. Expiration processing requires the queue monitor to be running.
While waiting for expiration, the message remains in the READY
state. If the message is not dequeued before it expires, it will be moved to the exception queue in the EXPIRED
state.
sb4
Any sb4 value is valid, but the following predefined constant is available:
READ
Specifies the state of the message at the time of the dequeue. This parameter cannot be set at enqueue time.
ub4
These are the only values which are returned:
READ/WRITE
Specifies the priority of the message. A smaller number indicates higher priority. The priority can be any number, including negative numbers.
The default value is zero.
sb4
WRITE
This parameter is only valid for queues which allow multiple consumers. The default recipients are the queue subscribers. This parameter is not returned to a consumer at dequeue time.
OCIAQAgent **
The following attributes are properties of the OCIAQAgent descriptor:
READ/WRITE
Protocol-specific address of the recipient. If the protocol is 0 (default), the address is of the form [schema.]queue[@dblink].
text *
Can be any string up to 128 bytes.
READ/WRITE
Name of a producer or consumer of a message.
text *
Can be any Oracle identifier, up to 30 bytes.
READ/WRITE
Protocol to interpret the address and propagate the message. The default (and currently the only supported) value is 0.
ub1
The only valid value is zero, which is also the default.