version 1.5
OD Get clause in context (context_ID; clauseNumber) Text
| Parameter | Type | Description | |
| context_ID | Longint | Context identifier | |
| clauseNumber | Integer | Number of clause to get | |
| Function result | Text | Text of the context clause |
Description
The OD Get clause in context function retrieves the text of a context clause.
context_ID must be a previously created, active or inactive context identifier.
clauseNumber can be one of the following clause numbers:
| Clause Number | Clause |
| 1 | FROM |
| 2 | WHERE |
| 3 | GROUP BY |
| 4 | HAVING |
| 5 | CONNECT BY |
| 6 | START WITH |
| 7 | ORDER BY |
If an error occurs, OD Get clause in context returns an empty string.
Example
The following method allows users to define their own contexts using the Edit a Context dialog box. Using this dialog box, users can add clauses such as a WHERE clause. After retrieving the WHERE clause, an additional restriction is added to the WHERE clause to prevent the user from obtaining information about the President:
Context_ID:= OD Create context dialog (Login_ID) `Create context
If (Context_ID>0) `If user did not click Cancel
clause:=OD Get clause in context (Context_ID;2) `Retrieve WHERE clause
If (clause#"") `If WHERE clause exists
clause:="("+clause+") AND " `add AND
End if `to prepare for concatenation
clause:=clause+"EMP.job <> 'President'" `Add condition
OD SET CLAUSE IN CONTEXT (Context_ID;2;clause) `Define WHERE clause
....
End if
See Also
OD EDIT CLAUSES IN CONTEXT, OD SET CLAUSE IN CONTEXT.