Previous | Next | Contents | Index | Navigation | Glossary | Library |
Optimization expressions can be numeric or character expressions and return a single value. They can also indicate a user-returned value based on a user-defined database stored procedure. The expression value for this autoselection / autoexclusion type is validated against the stored database procedure and checked for a single return value. See: PL/SQL Script: Sample Package Specifications or PL/SQL Script: Sample Package Body
Note: Numeric expressions that use division and reference clause names in the denominator could result in divide by 0 errors. These are treated as failed autoselections.
Numeric expressions can reference individual numeric functions within a constraint clause. Refer to the Syntax for Referencing Clause Functions section.
Character expressions can use both numeric or character clause name references. All literal values and clause name references must be concatenated and are validated as follows:
The optimization expression can parse the left, the right, or both sides of the constraint clause. For example:
SUM(memory ordered) < SUM(memory required)
where memory ordered is the left function and memory required is the right function. The less than operator separates the left function from the right.
The syntax for referencing individual functions of the constraint clause in the optimization expression is:
[clause_name,x]
where clause_name is the name of the clause and x is an uppercase 'L' or an uppercase 'R' to indicate the left or right side of the clause. This entire reference must be enclosed by brackets.
The clause name (referenced in the Constraints window) defaults to:
constraint_name:clause_sequence
where constraint_name is the name of the constraint, and clause_sequence is a sequence number (10, 20, 30, and so on) that defaults when the clause is written. The first clause written is 10, the second is 20. The third clause written is 30, even if it is inserted between the first and second. The default clause name and clause sequence can be overridden by the user with a user defined clause name.
When the clause name is defaulted, a colon separates the clause name from the sequence number for the purposes of referencing in an optimization expression. For example, the default name for the second clause of the MEM constraint is:
MEM:20
In the optimization expression, a comma (,) separates the clause name from the left or right side designator. The following example references the left side of the second clause of the MEM constraint:
[MEM:20,L]
Note: The optimization expression cannot contain blank spaces.
Example
A complete optimization expression using the MEM constraint and two constraint clauses, lines 10 and 20, might look like:
2+[MEM:20,L]*[MEM:10,R]
This optimization expression multiplies the left function of the second clause (MEM:20,L) by the right function of the first clause (MEM:10,R) and adds 2 to the result.
Previous | Next | Contents | Index | Navigation | Glossary | Library |