Scalar functions perform the designated operations on table fields or even on user data and return a single value for each row of the table. You can use scalar functions as part of both OUTER SELECT and INNER SELECT statements. The OUTER SELECT statement supplies the masked value of a DDM-configured field to the function if you do not have unmasking privileges, and returns a masked result after the processing concludes. The INNER SELECT statement supplies unmasked field values to the function, irrespective of the DDM privileges assigned to you.

The following example illustrates the CONCAT function using DDM-configured fields.
SELECT CONCAT (City, State) AS CustDetail FROM pub.Customer;
In this example, City and State are DDM-configured fields. The CONCAT function uses the masked values of City and State and returns a concatenated result of masked values for unauthorized users. For authorized users, the query returns the concatenated result of unmasked values.