Transformation Language Reference > The Transformation Language > Expression Syntax
  

Expression Syntax

Although the transformation language is based on standard SQL, there are difference between the two languages. For example, SQL supports the keywords ALL and DISTINCT for aggregate functions, but the transformation language does not. On the other hand, the transformation language supports an optional filter condition for aggregate functions, while SQL does not.
You can create an expression that is as simple as a port (such as ORDERS), a pre-defined workflow variable (such as $Start.Status), or a numeric literal (such as 10). You can also write complex expressions that include functions nested within functions, or combine different columns using the transformation language operators.

Expression Components

Expressions can consist of any combination of the following components:

Ports and Return Values

When you write an expression that includes a port or return value from an unconnected transformation, use the reference qualifiers in the following table:
Reference Qualifier
Description
:EXT
Required when you write an expression that includes a return value from an External Procedure transformation. The general syntax is:
:EXT.external_procedure_transformation(argument1, argument2, ...)
:LKP
Required when you create an expression that includes the return value from an unconnected Lookup transformation. The general syntax is:
:LKP.lookup_transformation(argument1, argument2, ...)
The arguments are the local ports used in the lookup condition. The order must match the order of the ports in the transformation. The datatypes for the local ports must match the datatype of the Lookup ports used in the lookup condition.
:SD
Optional (PowerMart 3.5 expressions only). Qualifies a source table port in an expression. The general syntax is:
:SD.source_table.column_name
:SEQ
Required when you create an expression that includes a port in a Sequence Generator transformation. The general syntax is:
:SEQ.sequence_generator_transformation.CURRVAL
:SP
Required when you write an expression that includes the return value from an unconnected Stored Procedure transformation. The general syntax is:
:SP.stored_procedure_transformation( argument1, argument2, [, PROC_RESULT])
The arguments must match the arguments in the unconnected Stored Procedure transformation.
:TD
Required when you reference a target table in a PowerMart 3.5 LOOKUP function. The general syntax is:
LOOKUP(:TD.SALES.ITEM_NAME, :TD.SALES.ITEM_ID, 10, :TD.SALES.PRICE, 15.99)

String and Numeric Literals

You can include numeric or string literals.
Be sure to enclose string literals within single quotation marks. For example:
'Alice Davis'
String literals are case sensitive and can contain any character except a single quotation mark. For example, the following string is not allowed:
'Joan's car'
To return a string containing a single quote, use the CHR function:
'Joan' || CHR(39) || 's car'
Do not use single quotation marks with numeric literals. Just enter the number you want to include. For example:
.05
or
$$Sales_Tax

Rules and Guidelines for Expression Syntax

Use the following rules and guidelines when you write expressions: