OD Get clause in 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 Get clause in context (context_ID; clauseNumber) Text

ParameterTypeDescription
context_IDLongintContext identifier
clauseNumberIntegerNumber of clause to get
Function resultTextText 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 NumberClause
1FROM
2WHERE
3GROUP BY
4HAVING
5CONNECT BY
6START WITH
7ORDER 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.


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