A script-enabled browser is required for this page to function properly.

Context object functions

This section describes the functions of the Oracle Forms Open API Context object.

d2fctxcr_Create( d2fctx **pd2fctx, d2fctxa *d2fctx_attr );

This function creates the context. You specify a handle for the Forms API to store the newly-created context in pd2fctx and a pointer to the attribute structure in pd2fctx_attr.

In order to create this context, you must define the actual attribute structure (d2fctxa) shown below:

typedef struct d2fctxa

{

ub4 mask_d2fctxa;

dvoid *cdata_d2fctxa; /* Client data */

d2fmalc d2fmalc_d2fctxa;

d2fmfre d2fmfre_d2fctxa;

d2fmrlc d2fmrlc_d2fctxa;

} d2fctxa;

d2fctxde_Destroy( d2fctx *pd2fctx );

This function destroys the specified context. You specify a pointer to the context in pd2fctx.

Note that you need to call this function last, once you are finished using the Forms API.

d2fctxsa_SetAttributes( d2fctx *pd2fctx, d2fctxa *pd2fctx_attr );

This function sets the specified attributes in your attribute structure. You specify a pointer to the context in pd2fctx, and a pointer to the attribute structure in pd2fctx_attr.

Note that you can use this function anytime you need to pass in client data or memory callbacks.

d2fctxga_GetAttributes( d2fctx *pd2fctx, d2fctxa *pd2fctx_attr );

This function gets the specified attributes from your attribute structure. You specify a pointer to the context in pd2fctx and a pointer to the attribute structure in pd2fctx_attr.

Note that you can use this function anytime you need to retrieve client data or memory callbacks.

d2fctxcn_Connect( d2fctx *pd2fctx, text *con_str, dvoid *phstdef );

This function connects you to the specified database. You specify a pointer to the context in pd2fctx , a pointer to the connect string in con_str, and optionally, an hstdef pointer (phstdef).

Note that the phstdef argument is supplied for advanced users who want to share an hstdef-enabled connection (the hstdef structure is externalized by the PL/SQL API) rather than establish a second connection and potentially slow performance. The hstdef pointer contains information about the database connection. If you set phstdef to NULL, the Forms API establishes a connection to the database you specify in con_str; otherwise, the function checks that the hstdef connection is valid and then uses the hstdef pointer to make the database connection. If the pstdef pointer is invalid or not connected, an error is returned. Most users should pass in a NULL pointer for the phstdef argument.

d2fctxdc_Disconnect( d2fctx *pd2fctx );

This function disconnects you from the current database connection.

d2fctxbv_BuilderVersion( d2fctx *pd2fctx, number *version );

This function returns the current version of the Oracle Forms. You specify a pointer to the context in pd2fctx and a pointer to version number in version.