User-defined functions
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
User-defined functions (UDF) are called in a query just like other system-defined functions and are tied to the table context. If a user-defined function uses a DDM-configured field, you cannot view the data unless you are authorized to unmask that field.
Example
The following example illustrates a
In this example, the UDF code increases the discount by the given
percentage. Run a
SELECT statement that uses a
DDM-configured field as an input parameter to invoke a UDF.
|
SELECT statement to call the
IncDiscount function by passing the Discount
field of the PUB.Customer table as an input parameter along with
the percentage value. Here, Discount is a DDM-configured field. If
you have the necessary unmasking privileges, the UDF uses the unmasked values of
Discount to calculate the discount increment. In the absence of
these privileges, it uses the masked value of Discount .