Oracle® Call Interface Programmer's Guide 10g Release 1 (10.1) Part Number B10779-01 |
|
|
View PDF |
This appendix describes the attributes for OCI handles and descriptors, which can be read with OCIAttrGet()
, and modified with OCIAttrSet()
.
This appendix contains these topics:
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 valid:
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()
.
This 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
The login name (DN) to use when connecting to the LDAP server.
OraText *
READ/WRITE
When this attribute is set to TRUE
, during OCICacheFlush()
the objects that belong to the same table are flushed together, which can considerably improve performance. This mode should only be used when the order in which the objects are flushed is not important. During this mode it is not guaranteed that the order in which the objects are marked dirty is preserved.
boolean
READ/WRITE
Sets the maximum size (high watermark) for the client-side object cache as a percentage of the optimal size. Set the value at 110% of the optimal size (OCI_ATTR_CACHE_OPT_SIZE). The object cache uses the maximum and optimal values for freeing unused memory in the object cache.
ub4 *
READ/WRITE
Sets the optimal size for the client-side object cache in bytes. The default value is 8M bytes.
ub4 *
READ
Local (client-side) character set ID. Users can update this setting only after creating the environment handle but before calling any other OCI functions. This restriction ensures the consistency among data and metadata in the same environment handle. In UTF-16 mode, an attempt to get this attribute is invalid.
ub2 *
READ
Local (client-side) national character set ID. Users can update this setting only after creating the environment handle but before calling any other OCI functions. This restriction ensures the consistency among data and metadata in the same environment handle. In UTF-16 mode, an attempt to get this attribute is invalid.
ub2 *
READ
Encoding method is UTF-16. The value 1 means that the environment handle is created in UTF-16 mode, while 0 means that it is not. This mode can only be set by the call to OCIEnvCreate()
and cannot be changed later.
ub1 *
READ/WRITE
The authentication mode. The following are the valid values:
0x0: No authentication; anonymous bind.
0x1: Simple authentication; user name and password authentication.
0x5: SSL connection with no authentication.
0x6: SSL: only server authentication required.
0x7: SSL: both server authentication and client authentication are required.
0x8: Authentication method will be determined at runtime.
ub2
READ/WRITE
If the authentication method is "simple authentication" (user name and password authentication), then this attribute holds the password to use when connecting to the LDAP server.
OraText *
READ/WRITE
The administrative context of the client. This is usually the root of the Oracle RDBMS LDAP schema in the LDAP server.
OraText *
READ/WRITE
The name of the host on which the LDAP server runs.
OraText *
READ/WRITE
The port on which the LDAP server is listening.
ub2
READ
Returns TRUE if the environment was initialized in object mode.
boolean *
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 *
READ/WRITE
This attribute sets the value of OCI_DURATION_DEFAULT for pin durations for the application associated with the environment handle.
OCIDuration *
READ
The current size of the memory allocated from the environment handle. This may help you track where memory is being used most in an application.
ub4 *
READ/WRITE
When this attribute is set to TRUE
, newly created objects have non-NULL
attributes.
boolean *
READ/WRITE
When this attribute is set to TRUE
, applications receive an ORA-08179 error when attempting to flush an object which has been modified in the server by another committed transaction.
boolean *
READ
Returns the size of the memory currently allocated from the shared pool. This attribute works on any environment handle but the process must be initialized in shared mode to return a meaningful value. This attribute is read as follows:
ub4 heapsz = 0; OCIAttrGet((dvoid *)envhp, (ub4)OCI_HTYPE_ENV, (dvoid *) &heapsz, (ub4 *) 0, (ub4)OCI_ATTR_SHARED_HEAPALLOC, errhp);
ub4 *
READ/WRITE
If the authentication method is SSL authentication, this attribute contains the location of the client wallet.
OraText *
READ
Returns the offset (into the DML array) at which the error occurred.
ub4 *
READ
returns the environment context associated with the service context.
OCIEnv **
READ
Allows you to determine whether an application has switched to Oracle release 7 mode (for example, through an OCISvcCtxToLda()
call). A nonzero (true) return value indicates that the application is currently running in Oracle release 8 mode, a zero (false) return value indicates that the application is currently running in Oracle release 7 mode.
ub1 *
The following code sample shows how this parameter is 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/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 **
/ OCIServer *
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 **
/ OCISession *
READ/WRITE
The default value of the statement cache size is 20, for a statement cache enabled session. The user can increase or decrease this value, by setting this attribute on the service context handle.
ub4 *
/ ub4
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 **
/ OCITrans *
READ
Returns the environment context associated with the server context.
OCIEnv **
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.
OraText **
(READ) / OraText *
(WRITE)
READ/WRITE
OCIFocbkStruct *
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.
OraText **
(READ) / OraText *
(WRITE)
READ
Allows you to determine whether an application has switched to Oracle release 7 mode (for example, through an OCISvcCtxToLda()
call). A nonzero (TRUE
) return value indicates that the application is currently running in Oracle release 8 mode, a zero (FALSE
) return value indicates that the application is currently running in Oracle release 7 mode.
ub1 *
READ/WRITE
This attribute determines the blocking mode. When read, the attribute value returns TRUE
if the server context is in nonblocking mode. When set, it toggles the nonblocking mode attribute.
ub1
READ/WRITE
An alpha-numeric string not exceeding 30 characters specifying the server group.
ub4
READ
Returns the current status of the server handle. Values are:
ub4
The following code sample shows how this parameter is used:
ub4 serverStatus = 0 OCIAttrGet((dvoid *)srvhp, OCI_HTYPE_SERVER, (dvoid *)&serverStatus, (ub4 *)0, OCI_ATTR_SERVER_STATUS, errhp); if (serverStatus == OCI_SERVER_NORMAL) printf("Connection is up.\n"); else if (serverStatus == OCI_SERVER_NOT_CONNECTED) printf("Connection is down.\n");
These attributes also apply to the user session handle.
These attributes also apply to the authentication information handle.
WRITE
The name of the current action within the current module. Can be set to NULL
. When the current action terminates, set this attribute again with the name of the next action or NULL,
if there is no next action. Can be up to 32 bytes long.
OraText *
OCIAttrSet(session, OCI_HTYPE_SESSION,(dvoid *)"insert into employees", (ub4)strlen("insert into employees"), OCI_ATTR_ACTION, error_handle);
WRITE
Specifies an attribute name of the externally initialized context.
OraText *
READ
Gets the application context list descriptor for the session.
OraText *
WRITE
Specifies the namespace of the externally initialized context.
OraText *
WRITE
Initializes the externally initialized context array size with the number of attributes.
OraText *
WRITE
Specifies a value of the externally initialized context.
OraText *
WRITE
Specifies the certificate of the client for use in proxy authentication.
ub1 *
WRITE
Specifies the type for proxy authentication. If not specified, the default type of X.509 is used.
OraText *
READ
Returns the server-side time for the preceding call in milliseconds.
ub8
WRITE
Specifies the user identifier in the session handle. Can be up to 64 bytes long. It can contain the user name, but you are asked not to include the password for security reasons. The first character of the identifier should not be ':'. If it is, the behavior is unspecified.
OraText *
OCIAttrSet(session, OCI_HTYPE_SESSION,(dvoid *)"janedoe", (ub4)strlen("janedoe"), OCI_ATTR_CLIENT_IDENTIFIER, error_handle);
WRITE
Client application additional information. Can also be set by the DBMS_APPLICATION_INFO package. It is stored in the V$SESSION view. Up to 64 bytes long.
OraText *
READ/WRITE
When set to TRUE
, causes the server to measure call time, in milliseconds, for each subsequent OCI call.
boolean
WRITE
Specifies distinguished name of the client for use in proxy authentication.
OraText *
WRITE
Specifies the role or roles that the client is to initially possess when the application server connects to Oracle on its behalf.
ub4
READ/WRITE
Specifies the session identified for the session handle. Allows you to clone a session from one environment to another, in the same process or between processes. These processes can be on the same machine or different machines. For a session to be cloned, the session must be authenticated as migratable.
ub1 *
The following code sample shows how this attribute is used:
OCIAttrSet ((dvoid *) authp, (ub4)OCI_HTYPE_SESSION, (dvoid *) mig_session, (ub4) sz, (ub4)OCI_ATTR_MIGSESSION, errhp);
WRITE
The name of the current module running in the client application. When the current module terminates, call with the name of the new module, or NULL
if there is no new module. Can be up to 48 bytes long.
OraText *
OCIAttrSet(session, OCI_HTYPE_SESSION,(dvoid *)"add_employee", (ub4)strlen("add_employee"), OCI_ATTR_MODULE, error_handle);
WRITE
Specifies a password to use for authentication.
OraText *
WRITE
Specifies that the credentials of the application server are to be used for proxy authentication.
ub4
WRITE
Specifies a user name to use for authentication.
OraText *
READ/WRITE
Connections idle for more than this time value (in seconds) are terminated, to maintain an optimum number of open connections.This attribute can be set dynamically. If this attribute is not set, the connections are never timed out.
ub4 */ub4
READ/WRITE
This attribute determines if retrial for a connection has to be done when all connections in the pool are found to be busy and the number of connections has already reached the maximum.
If this attribute is set, an error is thrown when all the connections are busy and no more connections can be opened. Otherwise the call waits till it gets a connection.
When read, the attribute value is returned as TRUE if it has been set.
ub1 */ub1
READ
Returns the number of busy connections.
ub4 *
READ
Returns the number of open connections.
ub4 *
READ
Returns the number of minimum connections.
ub4 *
READ
Returns the number of maximum connections.
ub4 *
READ
Returns the connection increment parameter.
ub4 *
The attributes used for session pooling are:
READ
Returns the number of busy sessions.
ub4 *
READ/WRITE
This attribute determines the behavior of the session pool when all sessions in the pool are found to be busy and the number of sessions has already reached the maximum. Values are:
OCISessionGet()
returns a warning. In this case, if new sessions are created that have exceeded the maximum, OCISessionGet()
returns a warning.
Note that if this value is set, it is possible that there can be an attempt to create more sessions than can be supported by the instance of the Oracle database server. In this case, the server will return the following error:
ORA 00018 - Maximum number of sessions exceeded
In this case, the error will be propagated to the session pool user.
When read, the appropriate attribute value is returned.
ub1 */ ub1
READ
Returns the session increment parameter.
ub4 *
READ
Returns the number of maximum sessions.
ub4 *
READ
Returns the number of minimum sessions.
ub4 *
READ
Returns the number of open sessions.
ub4 *
READ/WRITE
The sessions idle for more than this time (in seconds) are terminated periodically, to maintain an optimum number of open sessions.This attribute can be set dynamically. If this attribute is not set, the least recently used sessions may be timed out if and when space in the pool is required.
ub4 */ ub4
READ/WRITE
ub4 */ ub4
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 OraText string can be up to 64 bytes long.
OraText **
(READ) / OraText *
(WRITE)
READ/WRITE
Can set or read a timeout value used at prepare time.
ub4 *
(READ) / ub4
(WRITE)
READ/WRITE
Can set or read an XID which identifies a transaction.
XID **
(READ) / XID *
(WRITE)
READ
Indicates the current position in the result set. This attribute can only be retrieved. It cannot be set.
ub4 *
READ
Returns the environment context associated with the statement.
OCIEnv **
READ
Returns the number of errors in the DML operation.
ub4 *
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 *
... int i = 0; ub4 parmcnt = 0; ub2 type = 0; OCIParam *colhd = (OCIParam *) 0; /* column handle */ /* Describe of a select-list */ OraText *sqlstmt = (OraText *)"SELECT * FROM employees WHERE employee_id = 100"; checkerr(errhp, OCIStmtPrepare(stmthp, errhp, (OraText *)sqlstmt, (ub4)strlen((char *)sqlstmt), (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT)); checkerr(errhp, OCIStmtExecute(svchp, stmthp, errhp, 1, 0, (OCISnapshot *)0, (OCISnapshot *)0, OCI_DESCRIBE_ONLY)); /* Get the number of columns in the select list */ checkerr(errhp, OCIAttrGet((dvoid *)stmthp, OCI_HTYPE_STMT, (dvoid *)&parmcnt, (ub4 *)0, OCI_ATTR_PARAM_COUNT, errhp)); /* go through the column list and retrieve the datatype of each column. We start from pos = 1 */ for (i = 1; i <= parmcnt; i++) { /* get parameter for column i */ checkerr(errhp, OCIParamGet((dvoid *)stmthp, OCI_HTYPE_STMT, errhp, (dvoid **)&colhd, i)); /* get data-type of column i */ type = 0; checkerr(errhp, OCIAttrGet((dvoid *)colhd, OCI_DTYPE_PARAM, (dvoid *)&type, (ub4 *)0, OCI_ATTR_DATA_TYPE, errhp)); } ...
READ
Returns the parse error offset for a statement.
ub2 *
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 *
WRITE
Sets the number of top level rows to be prefetched. The default value is 1 row.
ub4 *
READ
Returns the number of rows processed so far after SELECT statements. For INSERT, UPDATE, and DELETE statements, it is the number of rows processed by the most recent statement. The default value is 1.
For non-scrollable cursors, OCI_ATTR_ROW_COUNT is the total number of rows fetched into user buffers with the OCIStmtFetch2()
calls issued since this statement handle was executed. Since they are forward sequential only, this also represents the highest row number seen by the application.
For scrollable cursors, OCI_ATTR_ROW_COUNT will represent the maximum (absolute) row number fetched into the user buffers. Since the application can arbitrarily position the fetches, this need not be the total number of rows fetched into the user's buffers since the (scrollable) statement was executed.
ub4 *
READ
Returns the ROWID
descriptor allocated with OCIDescriptorAlloc()
.
OCIRowid *
READ
Indicates the number of rows that were successfully fetched into the user's buffers in the last fetch or execute with nonzero iterations. It can be used for both scrollable and non-scrollable statement handles.
ub4 *
ub4 rows; ub4 sizep = sizeof(ub4); OCIAttrGet((dvoid *) stmhp, (ub4) OCI_HTYPE_STMT, (dvoid *)& rows, (ub4 *) &sizep, (ub4)OCI_ATTR_ROWS_FETCHED, errhp);
READ
Returns the function code of the SQL command associated with the statement.
ub2 *
See Also:
The SQL command codes are listed in Table A-1, "SQL Command Codes" |
READ
Returns the text of the SQL statement prepared in a statement handle. In UTF-16 mode, the returned statement is in UTF-16 encoding. The length is always in bytes.
OraText *
READ
Returns the fetch state of that statement. This attribute can be used by the caller to determine if the session can be used in another service context or if it is still needed in the current set of data access calls. Basically, if we are in the middle of a fetch-execute cycle, then we do not want to release the session handle for another statement execution. Valid values are:
ub4 *
READ
The type of statement associated with the handle. Valid values are:
ub2 *
WRITE
ub4 *
READ/WRITE
Character set form of the bind handle. The default form is SQLCS_IMPLICIT. Setting this attribute will cause the bind handle to use the database or national character set on the client side. Set this attribute to SQLCS_NCHAR for the national character set or SQLCS_IMPLICIT for the database character set.
ub1 *
READ/WRITE
Character set ID of the bind handle. If the character set of the input data is UTF-16 (replaces the deprecated OCI_UCS2ID, which is retained for backward compatibility), the user has to set the character set ID to OCI_UTF16ID. The bind value buffer is assumed to be a utext
buffer and length semantics for input length pointers and return values changes to character semantics (number of utext
s). However the size of the bind value buffer in the preceeding OCIBind
call has to be stated in bytes.
If OCI_ATTR_CHARSET_FORM is set, then OCI_ATTR_CHARSET_ID should be set only afterward. Setting OCI_ATTR_CHARSET_ID prior to setting OCI_ATTR_CHARSET_FORM will cause unexpected results.
ub2 *
WRITE
Sets the number of characters that an application reserves on the server to store the data being bound.
sb4 *
READ/WRITE
sb4 *
WRITE
Specifies packed decimal precision. For SQLT_PDN values, the precision should be equal to 2*(value_sz-1)
. For SQLT_SLS values, the precision should be equal to (value_sz-1)
.
After a bind or define, this value is initialized to zero. The OCI_ATTR_PDPRC attribute should be set first, followed by OCI_ATTR_PDSCL. If either of these values needs to be changed, a rebind/redefine should be done first, and then the two attributes should be reset in order.
ub2 *
WRITE
Specifies the scale for packed decimal values.
After a bind or define, this value is initialized to zero. The OCI_ATTR_PDPRC attribute should be set first, followed by OCI_ATTR_PDSCL. If either of these values needs to be changed, a rebind/redefine should be done first, and then the two attributes should be reset in order.
sb2 *
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 *
WRITE
This attribute is deprecated.
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 form of the define handle. The default form is SQLCS_IMPLICIT. Setting this attribute will cause the define handle to use the database or national character set on the client side. Set this attribute to SQLCS_NCHAR for the national character set or SQLCS_IMPLICIT for the database character set.
ub1 *
READ/WRITE
The character set ID of the define handle. If the character set of the output data should be UTF-16, the user has to set the character set IDOTT to OCI_UTF16ID. The define value buffer is assumed to be a utext
buffer and length semantics for indicators and return values changes to character semantics (number of utexts). However the size of the define value buffer in the preceeding OCIDefine
call has to be stated in bytes.
If OCI_ATTR_CHARSET_FORM is set, then OCI_ATTR_CHARSET_ID should be set only afterward. Setting OCI_ATTR_CHARSET_ID prior to setting OCI_ATTR_CHARSET_FORM will cause unexpected results.
ub2 *
WRITE
Specifies the maximum number of characters the client application allows in the define buffer.
sb4 *
WRITE
Specifies packed decimal precision. For SQLT_PDN values, the precision should be equal to 2*(value_sz-1)
. For SQLT_SLS values, the precision should be equal to (value_sz-1)
.
After a bind or define, this value is initialized to zero. The OCI_ATTR_PDPRC attribute should be set first, followed by OCI_ATTR_PDSCL. If either of these values needs to be changed, a rebind/redefine should be done first, and then the two attributes should be reset in order.
ub2 *
WRITE
Specifies the scale for packed decimal values.
After a bind or define, this value is initialized to zero. The OCI_ATTR_PDPRC attribute should be set first, followed by OCI_ATTR_PDSCL. If either of these values needs to be changed, a rebind/redefine should be done first, and then the two attributes should be reset in order.
sb2 *
READ
Points to the root of the description. Used for subsequent calls to OCIAttrGet()
and OCIParamGet()
.
ub4 *
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 *
See Also:
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 (that is, BLOB
, CLOB
, NCLOB
).
Applications should pass address of a ub4
which has a value of 0; for example, declare:
ub4 lobEmpty = 0
then pass address &lobEmpty
.
ub4 *
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_COMPLEXOBJECTCOMP_TYPE
.
ub4 *
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
.
OraText *
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.
OraText *
READ/WRITE
Specifies the locking behavior associated with the dequeue.
ub4
The only valid values are:
SELECT
statement.SELECT
FOR
UPDATE
statement.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:
OCIAQDeqArray()
will reset the position to the beginning of the queue and dequeue messages from a single transaction group that are available and match the search criteria. If the number of messages in the single transaction group exceeds iters
, then you must make a subsequent call to OCIAQDeqArray()
using the OCI_DEQ_NEXT_MSG_ONE_GROUP navigation.OCIAQDeqArray()
will dequeue the next set of messages (up to iters
) that are available, match the search criteria and belong to the message group.OCIAQDeqArray()
will reset the position to the beginning of the queue and dequeue messages (possibly across different transaction groups) that are available and match the search criteria, until reaching the iters
limit. To distinguish between transaction groups, a new message property, OCI_ATTR_TRANSACTION_NO, will be defined. All messages belonging to the same transaction group will have the same value for this message property.OCIAQDeqArray()
will dequeue the next set of messages (possibly across different transaction groups) that are available and match the search criteria, until reaching the iters
limit. To distinguish between transaction groups, a new message property, OCI_ATTR_TRANSACTION_NO, will be defined. All messages belonging to the same transaction group will have the same value for this message property.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.
OraText *
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.
OraText *
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 **
READ/WRITE
Identifies the original sender of a message.
OCIAgent *
READ
For transaction-grouped queues, this identifies the transaction group of the message. This attribute is populated after a successful OCIAQDeqArray()
call. All messages in a group have the same value for this attribute. This attribute cannot be used by the OCIAQEnqArray()
call to set the transaction group for an enqueued message.
OraText *
READ/WRITE
The ID of the message in the last queue that generated this message. When a message is propagated from one queue to another, this attribute identifies the ID of the queue from which it was last propagated. When a message has been propagated through multiple queues, this attribute identifies the ID of the message in the last queue that generated this message, not the first queue.
OCIRaw *
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
].
OraText *
Can be any string up to 128 bytes.
READ/WRITE
Name of a producer or consumer of a message.
OraText *
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.
The following attributes are properties of the OCIServerDNs
descriptor:
READ
The number of database servers in the descriptor.
ub2
READ/WRITE
For read mode, this attribute returns the list of database server distinguished names that are already inserted into the descriptor.
For write mode, this attribute takes the distinguished name of a database server.
OraText **/OraText *
READ/WRITE
The distinguished names of the database servers that the client is interested in for the registration.
OCIServerDNs *
READ/WRITE
Subscription callback. If the attribute OCI_ATTR_SUBSCR_RECPTPROTO is set to OCI_SUBSCR_PROTO_OCI or is left not set, then this attribute needs to be set before the subscription handle can be passed into the registration call OCISubscriptionRegister()
.
OCISubscriptionNotify *
READ/WRITE
Context that the client wants to get passed to the user callback denoted by OCI_ATTR_SUBSCR_CALLBACK when it gets invoked by the system. If the attribute OCI_ATTR_SUBSCR_RECPTPROTO is set to OCI_SUBSCR_PROTO_OCI or is left not set, then this attribute needs to be set before the subscription handle can be passed into the registration call OCISubscriptionRegister()
.
dvoid *
READ/WRITE
Subscription name. All subscriptions are identified by a subscription name. A subscription name consists of a sequence of bytes of specified length. The length in bytes of the name needs to be specified as it is not assumed that the name will be NULL
-terminated. This is important because the name could contain multibyte characters.
Clients will be able to set the subscription name attribute of a Subscription handle using an OCIAttrSet()
call and by specifying a handle type of OCI_HTYPE_SUBSCR and an attribute type of OCI_ATTR_SUBSCR_NAME.
All of the subscription callbacks need a subscription handle with the OCI_ATTR_SUBSCR_NAME and OCI_ATTR_SUBSCR_NAMESPACE attributes set. If the attributes are not set, an error is returned. The subscription name that is set for the subscription handle must be consistent with its namespace.
OraText *
READ/WRITE
Namespace in which the subscription handle is used. The valid values for this attribute are OCI_SUBSCR_NAMESPACE_AQ and OCI_SUBSCR_NAMESPACE_ANONYMOUS. The subscription name that is set for the subscription handle must be consistent with its namespace.
ub4 *
READ/WRITE
Buffer that corresponds to the payload that needs to be sent along with the notification. The length of the buffer can also be specified in the same set attribute call. This attribute needs to be set before a post can be performed on a subscription. For this release, only an untyped (ub1 *) payload is supported.
ub1 *
READ/WRITE
The name of the recipient of the notification when the attribute OCI_ATTR_SUBSCR_RECPTPROTO is set to OCI_SUBSCR_PROTO_MAIL, OCI_SUBSCR_PROTO_HTTP, or OCI_SUBSCR_PROTO_SERVER.
For OCI_SUBSCR_PROTO_HTTP, OCI_ATTR_SUBSCR_RECPT denotes the HTTP URL (for example, http://www.oracle.com:80) to which notification is sent. The validity of the HTTP URL is never checked by the database.
For OCI_SUBSCR_PROTO_MAIL, OCI_ATTR_SUBSCR_RECPT denotes the e-mail address (for example, xyz@oracle.com) to which the notification is sent. The validity of the e-mail address is never checked by the database system.
For OCI_SUBSCR_PROTO_SERVER, OCI_ATTR_SUBSCR_RECPT denotes the database procedure (for example: schema.procedure
) that will be invoked in the event of a notification. The subscriber should have appropriate permissions on the procedure for it to be executed.
See Also:
For information about procedure definition, see "Notification Procedure" |
OraText *
READ/WRITE
The presentation with which the client wants to receive the notification. The valid values for this are OCI_SUBSCR_PRES_DEFAULT and OCI_SUBSCR_PRES_XML.
If not set, this attribute defaults to OCI_SUBSCR_PRES_DEFAULT.
If the event notification is desired in XML presentation then this attribute should be set to OCI_SUBSCR_PRES_XML. Otherwise, it should be left not set or set to OCI_SUBSCR_PRES_DEFAULT.
ub4
READ/WRITE
The protocol with which the client wants to receive the notification. The valid values for this are
If an OCI client is interested in receiving the event notification, then this attribute should be set to OCI_SUBSCR_PROTO_OCI.
If you want an e-mail to be sent on event notification, then set this attribute to OCI_SUBSCR_PROTO_MAIL. If you want a PL/SQL procedure to be invoked in the database on event notification, then set this attribute to OCI_SUBSCR_PROTO_SERVER. If you want a HTTP URL to be posted to on event notification, then set this attribute to OCI_SUBSCR_PROTO_HTTP.
If not set, this attribute defaults to OCI_SUBSCR_PROTO_OCI.
For OCI_SUBSCR_PROTO_OCI, the attributes OCI_ATTR_SUBSCR_CALLBACK and OCI_ATTR_SUBSCR_CTX must be set before the subscription handle can be passed into the registration call OCISubscriptionRegister()
.
For OCI_SUBSCR_PROTO_MAIL, OCI_SUBSCR_PROTO_SERVER, and OCI_SUBSCR_PROTO_HTTP, the attribute OCI_ATTR_SUBSCR_RECPT must be set before the subscription handle can be passed into the registration call OCISubscriptionRegister()
.
ub4
See Also:
For information about direct path loading and allocating the direct path handles, see "Direct Path Loading Overview" and"Direct Path Loading of Object Types" |
READ/WRITE
Sets the size of the stream transfer buffer. Default value is 64KB.
ub4 */ub4 *
READ/WRITE
Default character set ID for the character data. Note that the character set ID can be overridden at the column level. If character set ID is not specified at the column level or the table level, then the Global support environment setting is used.
ub2 */ub2 *
READ/WRITE
Default date format string for SQLT_CHAR to DTYDAT conversions. Note that the date format string can be overridden at the column level. If date format string is not specified at the column level or the table level, then the Global Support environment setting is used.
OraText **/OraText *
READ/WRITE
Setting this attribute to 1 indicates that the date cache will be disabled if exceeded. The default value is 0, which means that lookups in the cache will continue on cache overflow.
See Also:
"Using a Date Cache in Direct Path Loading of Dates in OCI" for a complete description of this attribute and of the four following attributes. |
ub1 */ub1 *
READ
Queries the number of date cache hits.
ub4 *
READ
Queries the current number of date cache misses.
ub4 *
READ
Queries the current number of entries in a date cache.
ub4 *
READ/WRITE
Sets the date cache size (in elements) for a table. To disable the date cache, set to 0, which is the default value.
ub4 *
/ub4 *
READ/WRITE
Performs index row insertion on a per row basis.
Valid value is:
OCI_DIRPATH_INDEX_MAINT_SINGLE_ROW
ub1 *
/ub1 *
READ/WRITE
Mode of the direct path context:
ub1 */ub1 *
READ/WRITE
The NOLOG attribute of each segment determines whether image redo or invalidation redo is generated:
ub1 */ub1 *
READ/WRITE
Indicates the object type of a substitutable object table:
OraText *obj_type; /* stores an object type name */ OCIAttrSet((dvoid *)dpctx, (ub4)OCI_HTYPE_DIRPATH_CTX, (dvoid *) obj_type, (ub4)strlen((const char *) obj_type), (ub4)OCI_ATTR_DIRPATH_OBJ_CONSTR, errhp);
OraText **/OraText *
READ/WRITE
Setting this value to 1 allows multiple load sessions to load the same segment concurrently. The default is 0 (not parallel).
ub1 */ub1 *
READ/WRITE
Indicates how the handling of unusable indexes will be performed.
Valid values are:
ub1 *
/ub1 *
READ
Returns the handle to the parameter descriptor for the column list associated with the direct path context. The column list parameter descriptor can be retrieved after the number of columns is set with the OCI_ATTR_NUM_COLS attribute.
OCIParam* *
READ/WRITE
Name of the table to be loaded into.
OraText**/OraText *
READ/WRITE
Number of columns being loaded in the table.
ub2 */ub2 *
READ/WRITE
Read: The number of rows loaded so far.
Write: The number of rows to be allocated for the direct path and the direct path function column arrays.
ub2 */ub2 *
READ/WRITE
Name of the schema where the table being loaded resides. If not specified, the schema defaults to that of the connected user.
OraText **/OraText *
READ/WRITE
Name of the partition, or subpartition, to be loaded. If not specified, the entire table is loaded. The name must be a valid partition or subpartition name which belongs to the table.
OraText **/OraText *
For further explanations of these attributes:
READ/WRITE
Indicates the type of expression specified in OCI_ATTR_NAME in the function context of a non-scalar column.
Valid values are:
ub1 */ub1 *
READ
Returns the handle to the parameter descriptor for the column list associated with the direct path function context. The column list parameter descriptor can be retrieved after the number of columns (number of attributes or arguments associated with the non-scalar column) is set with the OCI_ATTR_NUM_COLS attribute.
OCIParam**
READ/WRITE
The object type name if the function context is describing a column object, a SQL function if the function context is describing a SQL string, or a reference table name if the function context is describing a REF column.
OraText **/OraText *
READ/WRITE
The number of the object attributes to load if the column is a column object, or the number of arguments to process if the column is a SQL string or a REF column. This parameter must be set before the column list can be retrieved.
ub2 */ub2 *
READ
The number of rows loaded so far.
ub4 *
READ
Last column of the last row processed.
ub2 *
READ
Column dimension of the column array.
ub2 *
READ
Row dimension of the column array.
ub4 *
READ
Number of rows successfully converted in the last call to OCIDirPathColArrayToStream()
.
ub4 *
READ
Buffer address of the beginning of the stream data.
ub1 **
READ
Size of the stream data in bytes.
ub4 *
READ
Number of rows successfully loaded by the last OCIDirPathLoadStream()
call.
ub4 *
READ
Offset into the stream buffer of the last processed row.
ub4 *
The application specifies which columns are to be loaded, and the external format of the data by setting attributes on each column parameter descriptor. The column parameter descriptors are obtained as parameters of the column parameter list by OCIParamGet()
. The column parameter list of the table is obtained from the OCI_ATTR_LIST_COLUMNS attribute of the direct path context. If a column is non-scalar, then its column parameter list is obtained from the OCI_ATTR_LIST_COLUMNS attribute of its direct path function context.
Note that all parameters are 1-based.
The following code example illustrates the use of the direct path column parameter attributes for scalar columns. Before the attributes are accessed, you must first set the number of columns to be loaded and get the column parameter list from the OCI_ATTR_LIST_COLUMNS attribute.
See Also:
See the data structures defined in the listings in Direct Path Load Example for Scalar Columns |
... /* set number of columns to be loaded */ OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp, OCIAttrSet((dvoid *)dpctx, (ub4)OCI_HTYPE_DIRPATH_CTX, (dvoid *)&tblp->ncol_tbl, (ub4)0, (ub4)OCI_ATTR_NUM_COLS, ctlp->errhp_ctl)); /* get the column parameter list */ OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp, OCIAttrGet((dvoid *)dpctx, OCI_HTYPE_DIRPATH_CTX, (dvoid *)&ctlp->colLstDesc_ctl, (ub4 *)0, OCI_ATTR_LIST_COLUMNS, ctlp->errhp_ctl));
Now you can set the parameter attributes.
/* set the attributes of each column by getting a parameter handle on each * column, then setting attributes on the parameter handle for the column. * Note that positions within a column list descriptor are 1-based. */ for (i = 0, pos = 1, colp = tblp->col_tbl, fldp = tblp->fld_tbl; i < tblp->ncol_tbl; i++, pos++, colp++, fldp++) { /* get parameter handle on the column */ OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp, OCIParamGet((CONST dvoid *)ctlp->colLstDesc_ctl, (ub4)OCI_DTYPE_PARAM, ctlp->errhp_ctl, (dvoid **)&colDesc, pos)); colp->id_col = i; /* position in column array */ /* set external attributes on the column */ /* column name */ OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp, OCIAttrSet((dvoid *)colDesc, (ub4)OCI_DTYPE_PARAM, (dvoid *)colp->name_col, (ub4)strlen((const char *)colp->name_col), (ub4)OCI_ATTR_NAME, ctlp->errhp_ctl)); /* column type */ OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp, OCIAttrSet((dvoid *)colDesc, (ub4)OCI_DTYPE_PARAM, (dvoid *)&colp->exttyp_col, (ub4)0, (ub4)OCI_ATTR_DATA_TYPE, ctlp->errhp_ctl)); /* max data size */ OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp, OCIAttrSet((dvoid *)colDesc, (ub4)OCI_DTYPE_PARAM, (dvoid *)&fldp->maxlen_fld, (ub4)0, (ub4)OCI_ATTR_DATA_SIZE, ctlp->errhp_ctl)); if (colp->datemask_col) /* set column (input field) date mask */ { OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp, OCIAttrSet((dvoid *)colDesc, (ub4)OCI_DTYPE_PARAM, (dvoid *)colp->datemask_col, (ub4)strlen((const char *)colp->datemask_col), (ub4)OCI_ATTR_DATEFORMAT, ctlp->errhp_ctl)); } if (colp->prec_col) { OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp, OCIAttrSet((dvoid *)colDesc, (ub4)OCI_DTYPE_PARAM, (dvoid *)&colp->prec_col, (ub4)0, (ub4)OCI_ATTR_PRECISION, ctlp->errhp_ctl)); } if (colp->scale_col) { OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp, OCIAttrSet((dvoid *)colDesc, (ub4)OCI_DTYPE_PARAM, (dvoid *)&colp->scale_col, (ub4)0, (ub4)OCI_ATTR_SCALE, ctlp->errhp_ctl)); } if (colp->csid_col) { OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp, OCIAttrSet((dvoid *)colDesc, (ub4)OCI_DTYPE_PARAM, (dvoid *)&colp->csid_col, (ub4)0, (ub4)OCI_ATTR_CHARSET_ID, ctlp->errhp_ctl)); } /* free the parameter handle to the column descriptor */ OCI_CHECK((dvoid *)0, 0, ociret, ctlp, OCIDescriptorFree((dvoid *)colDesc, OCI_DTYPE_PARAM)); } ...
READ/WRITE
Character set ID for character column. If not set, the character set ID defaults to the character set ID set in the direct path context.
ub2 */ub2 *
READ/WRITE
Maximum size in bytes of the external data for the column. This can affect conversion buffer sizes.
ub4 */ub4 *
READ/WRITE
Returns or sets the external datatype of the column. Valid datatypes are:
ub2 */ub2 *
READ/WRITE
Date conversion mask for the column. If not set, the date format defaults to the date conversion mask set in the direct path context.
OraText **/OraText *
READ/WRITE
Indicates that the column to load into is a an object table's object id column.
ub1 */ub1 *
READ/WRITE
Indicates that the column to load into is a nested table's setid column.
ub1 */ub1 *
READ/WRITE
Returns or sets the name of the column that is being loaded.
OraText **/OraText *
READ/WRITE
Returns or sets the precision.
ub1 */ub1 *
for explicit describes
sb2 */sb2 *
for implicit describes
READ/WRITE
Returns or sets the scale (number of digits to the right of the decimal point) for conversions from packed and zoned decimal input datatypes.
sb1 */sb1 *
The parameters for the shared system can be set and read using the OCIAttrSet()
and OCIAttrGet()
calls. The handle type to be used is the process handle OCI_HTYPE_PROC.
The OCI_ATTR_MEMPOOL_APPNAME, OCI_ATTR_MEMPOOL_HOMENAME, and OCI_ATTR_MEMPOOL_INSTNAME attributes specify the application, home, and instance names that can be used together to map the process to the right shared pool area. If these attributes are not provided, internal default values are used. The following are valid settings of the attributes for specific behaviors:
READ/WRITE
Executable name or fully-qualified path name of the executable.
OraText *
READ/WRITE
Directory name where the executables that use the same shared subsystem instance are located.
OraText *
READ/WRITE
Any user-defined name to identify an instance of the shared subsystem.
OraText *
READ/WRITE
Size of the shared pool in bytes. This attribute is set as follows:
ub4 plsz = 1000000; OCIAttrSet((dvoid *)0, (ub4) OCI_HTYPE_PROC, (dvoid *)&plsz, (ub4) 0, (ub4) OCI_ATTR_POOL_SIZE, 0);
ub4 *
READ
Returns all the currently set process modes. The value read contains the OR'ed value of all the currently set OCI process modes. To determine if a specific mode is set, the value should be OR'ed with that mode. For example:
ub4 mode; boolean is_shared; OCIAttrGet((dvoid *)0, (ub4)OCI_HTYPE_PROC, (dvoid *) &mode, (ub4 *) 0, (ub4)OCI_ATTR_PROC_MODE, 0); is_shared = mode | OCI_SHARED;
ub4 *