SELECT
- Last Updated: December 21, 2023
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
The
SELECT statement retrieves field values from a table using a query.
SELECT can be:- The first statement of the query, known as
OUTER SELECT—Sends data out of the SQL engine. - Present in any inner part of the query, known as
INNER SELECT—Provides data to the other parts of the query for internal processing. Typically,INNER SELECTis used in subqueries.
SELECT statements can either use simple table fields or use complex
expressions, aggregate functions, or scalar functions on the field data. If you do
not have access to sensitive data or lack the unmasking privileges over
DDM-configured fields that are referenced by an OUTER SELECT
statement, the query result set contains masked values for these fields.
Regardless of your DDM privileges, INNER SELECT statements always
use unmasked field values for internal processing. Note: Fields used in the
SELECT list of the SELECT
query display the data at the client application and are therefore
always masked for unauthorized users. Examples
The following example illustrates a simple
In this example,
SELECT query that retrieves a
DDM-configured field.
|
Phone is a DDM-configured field. The query
displays the unmasked values of Phone if you have the necessary
unmasking privileges. In the absence of these privileges, the query displays masked
values.The following example illustrates a
In this example,
SELECT query with a mathematical
expression involving a DDM-configured field.
|
TotalPaid is a DDM-configured field. The
SQL engine uses the unmasked value of TotalPaid to calculate the
expression TotalPaid -(Amount + ShipCharge) and returns an expected
result, provided that you have the necessary unmasking privileges. However, in the
absence of these privileges, the SQL engine calculates the expression using the
masked value of TotalPaid and returns an inaccurate result, which
is an expected behavior.