version 1.5
OC ADD TO CONTEXT (context_ID; colName; 4DObject)
| Parameter | Type | Description | |
| context_ID | Longint | Context ID | |
| colName | String | ODBC column or expression | |
| 4DObject | String | Name of a 4th Dimension variable, array or field |
Description
The OC ADD TO CONTEXT command binds a 4th Dimension object with an ODBC column or expression. The bind is added to the context definition initiated by OC Create context.
context_ID must be a previously created and inactive context ID.
colName specifies either the name of an ODBC column (in the table.column or column format) or an SQL expression (such as "sal*1.15"). Unless you declared a default table name for a column you want to select, you must specify the table in which the column is located using the table.column format. You can specify a default table name using either OC Create context dialog or OC Create context.
4DObject is the name of a 4th Dimension field, variable, or array.
Example
The following method initiates a context definition and then defines the binds within the context:
Context_ID = OC Create context( "EMP") `Initiate a context definition OC ADD TO CONTEXT(Context_ID; "empno"; "[Employees]No") OC ADD TO CONTEXT(Context_ID; "ename"; "[Employees]Name") OC ADD TO CONTEXT(Context_ID; "sal"; "vSalary")
When the context is activated using OC Activate context, the following SELECT statement is sent to the ODBC server:
SELECT empno, ename, sal FROM emp
See Also
OC Activate context, OC Create context.