OD Create context

4D - Documentation   Français   English   German   English   4D for Oracle, Command Theme List   4D for Oracle, Command Alphabetical List   Back   Previous   Next

version 1.5


OD Create context {(tableName)} Longint

ParameterTypeDescription
tableNameStringDefault Oracle table
Function resultLongintContext Identifier or -1 if an error occurs

Description

The OD Create context function indicates that you wish to build a context and returns the identifier for that context.

Executing this function does not associate any 4th Dimension fields, variables, or arrays with Oracle columns. You specify these binds by calling OD ADD TO CONTEXT for each bind. You can set options for the context by calling OD SET OPTIONS.

tableName specifies the table that will be used as the default table for the OD ADD TO CONTEXT command if you do not explicitly name a table. tableName must be in the user.table or table form.

After you build a context using OD Create context and OD ADD TO CONTEXT, you must activate it by calling OD Activate context.

If an error occurs, OD Create context returns -1. Otherwise, it returns a valid context number greater than 0.

Examples

(1) The following statement initiates the Scott.EMP context.

   Context_ID := OD Create context ("Scott.EMP")

It is possible to specify several tables in the tableName parameter. To do so, the different table names have to be separated by a comma.

(2) To activate a context for the employees of the emp table while indicating their department name, you can write:

   ID_context:=OD Create context ("emp,dept")
   OD ADD TO CONTEXT (ID_context;"ename";->vEname)
   OD ADD TO CONTEXT (ID_context;"dname";->vDname)
   OD SET CLAUSE IN CONTEXT (ID_context;2;"emp.deptno = dept.deptno")
   $rc:=OD Activate context (ID_login;ID_context)

See Also

OD Activate context, OD ADD TO CONTEXT, OD Create context dialog, OD SET OPTIONS.


4D - Documentation   Français   English   German   English   4D for Oracle, Command Theme List   4D for Oracle, Command Alphabetical List   Back   Previous   Next