Query parameter clauses
In the One Identity Manager query language, query parameter clauses allow values to be passed in parameters that can be used in where clauses. You can pass a single parameter or a list of parameters.
Syntax for a single parameter
PARAM <Parameter name> [ OF <Type> ] = <Value>
Syntax for multiple parameters
PARAMS
<Param1> [ OF <Type> ] = <Value>,
<Param1> [ OF <Type> ] = <Value>,
Permitted parameter names are:
Valid types are the .Net data types of the object layer defined in ValType enumeration. If the type can be derived from the value, you do not have to give a type.
Examples of query parameters
PARAM Parameter1 = 'User'
PARAM @Parameter2 = 'User'
PARAM Parameter3 OF String = 'User'
PARAM @Parameter4 OF String = 'User'
PARAM Parameter5 = 42
PARAM Parameter6 OF Int = 42
PARAMS
Parameter7 OF Double = 3.14,
Parameter8 OF Date = 2020-04-30
Example: Complete query with parameter reference and definition
FROM Person
WHERE LastName = @Param1
SELECT DISPLAYS
PARAM Param1 = 'User'
Related topics
Query hints
Query hints (keyword HINT) can be used in the One Identity Manager query language to provide the query processor with additional data. Query hints are used internally to provide a context for additional permission queries to display columns that are only available when loaded as display values for foreign keys of another table.
HINT 'Name' = 'Value'
Example: Loading an identity that is referenced in a company structure as UID_PersonHead
FROM Person
WHERE PRIMARYKEY '<Key><T>Person</T><P>99918ef1-113f-480a-8e6e-704b1a3cf73a</P></Key>'
SELECT DISPLAYS
HINT 'SourceContext' = 'Org'
Conditions
Conditions combine all expressions that filter the resulting entities according to one or more criteria.
In the One Identity Manager query language, conditions can be linked with the AND and OR operators. You can overwrite operator precedence with curly brackets ({ }). Conditions can be inverted using the NOT keyword.
Example of a condition
WHERE Lastname = 'User'
AND (Firstname = 'Alex' OR Firstname = 'Sam')
Related topics
Special conditions
Selecting an entity using the primary key
n the One Identity Manager query language, use the PRIMARYKEY keyword to select the entity with the matching primary key. The primary key must be given in object key notation.
WHERE PRIMARYKEY 'Object Key'
Example
FROM Person
WHERE PRIMARYKEY '<Key><T>Person</T><P>99918ef1-113f-480a-8e6e-704b1a3cf73a</P></Key>'
SELECT DISPLAYS
Selecting an entity using a key
Use the KEY keyword to select the entity with the matching key. Keys can be object keys or alternative object keys, each in their XML notation.
WHERE KEY 'Key'
Example
FROM ADSAccount
WHERE KEY '<Key><Table Name="ADSAccount" Key="c149784b-6386-45d7-a38d-3c6e8e1b69d4"><Prop Name="UID_ADSAccount"><Value>c149784b-6386-45d7-a38d-3c6e8e1b69d4</Value></Prop></Table></Key>'
SELECT COLUMNS cn
Select using predefined SQL
With the LIMITEDSQL keyword you use a preformatted Where clause from the QBMLimitedSQL table. Any parameters used in it can be specified with the PARAMETER or the PARAMETERS clause.
WHERE LIMITEDSQL 'Identifier'