These features allow the user to be more creative within the environment.
Derived Field Descriptors (FDs)
Perhaps one of the most commonly used features in WOW, derived fields provide the ability to create a "virtual" field. This field is defined by a field descriptor, just a like a normal field, yet it does not actually exist in a physical file. It is simply a container field that can be used to return any value needed. It can be handled and manipulated just a like an actual database field.
A derived field is represented in SQL by a column name alias. For instance, the following SQL statement contains a derived field with the column name alias D_DETAILS:
SELECT 'Details' AS D_DETAILS, FIRSTNME, LASTNAME FROM PJDATA.EMPLOYEE
This statement returns three columns, in the following order: D_DETAILS, First Name, and Last Name.
Notice the first part of the column name alias ( 'Details' ) represents the initial value that is displayed in the derived field. A string, which requires single quotes, was used in this example but you could also instead use numbers, functions, other field names, etc. The second part ( AS D_DETAILS ) assigns an alias (column name) to the value defined in the first half.
Another method of creating a derived field in WOW is to use the !!<field name> notation within the SQL statement similar to this:
SELECT !!D_DETAILS, FIRSTNME, LASTNAME FROM PJDATA.EMPLOYEE
This statement returns three columns, in the following order: D_DETAILS, First Name, and Last Name.
Notice the fields in the Details column are all blank, unlike the first example which required you to set a value in the field or pull a value from another field in the database. This method allows us to include a derived field in a result table without requiring you to pull a value from the database or set value on the field. This method is especially useful when creating derived fields for Tabbed Operations. Please note that this method requires you to create a derived field descriptor before the operation will run properly.
Note: Consider creating a derived field for any type of Operation that you want to set an action on. This helps save time in the future in case you are referencing the original field multiple times with multiple queries or commands in SQL.
Adding action to a original field such as an Association Operation or Possible Values Operation, this will render different results anywhere the field is being referenced.