%OPRCLAUSE meta-SQL element

Description

The %OPRCLAUSE meta variable is used in the view text of dynamic views.

To support the concept of a specific row-level security class, this meta variable fills in the WHERE clause with the value from PSOPRDEFN.OPRID, PSOPRDEFN.OPRCLASS, or PSOPRDEFN.ROWSECCLASS depending which is present in the SELECT clause.

%OPRCLAUSE must be either all uppercase or all lowercase.

%OPRCLAUSE translates to OprId, OprClass or RowSecClass, following the same rules used for security on search dialog boxes. If OPRID is in the view, %OPRCLAUSE expands to OPRID = 'current operator'. If OPRCLASS is in the view, %OPRCLAUSE expands to OPRCLASS = 'primary permission list'. If ROWSECCLASS is in the view, %OPRCLAUSE expands to ROWSECCLASS = 'row security permission list'.

Example

Here is an example:

SELECT EMPLID, ABSENCE_TYPE, OPRID FROM PS_ABSENCE_HIST WHERE %OPRCLAUSE 
AND (EMPLID='8001' AND ABSENCE_TYPE='CNF')  

This code expands to:

SELECT EMPLID, ABSENCE_TYPE, OPRID FROM PS_ABSENCE_HIST WHERE ( OPRID 'PTDMO') 
AND (EMPLID='8001' AND ABSENCE_TYPE='CNF') 

Here's another example:

SELECT EMPLID, ABSENCE_TYPE, OPRCLASS FROM PS_ABSENCE_HIST WHERE %OPRCLAUSE AND
(EMPLID='8001' AND ABSENCE_TYPE='CNF')

This code expands to:

SELECT EMPLID, ABSENCE_TYPE, OPRCLASS FROM PS_ABSENCE_HIST WHERE ( OPRCLASS ='ALLPANLS')
AND (EMPLID='8001' AND ABSENCE_TYPE='CNF')