Expand expands TurboIntegrator variable names, enclosed in % signs, to their values at run time. A common use of the Expand function is to pass the value of TurboIntegrator variables to the ODBCOutput function.
If the variable name represents a string variable, the entire variable expression must be enclosed on quotes. For example, "%V1%".
If Expand is fed with a numerical value, an implicit type conversion is performed and the numerical value is converted into a string.
That string has a fixed minimum length of 10 characters. If the converted number is too small to fill 10 characters, it is padded with leading spaces. Only three leading decimal characters are converted. For example, a numerical value of 0.123456789 is converted into the string "0.123".
This function is valid in TM1® TurboIntegrator processes only.
Any string that includes TurboIntegrator variable names enclosed in % signs.
ODBCOutPut( 'TransData', Expand( 'INSERT INTO SALES( MONTH, PRODUCT, SALES ) VALUES ( "%V0%", "%V1%",%V2% )' ) );
This example illustrates the use of the Expand function within the ODBCOutput function. The example inserts records into a relational table named Sales that consists of three columns: Month, Product, and Sales.
The Expand function converts the variables V0, V1, and V2 to their actual values within the view. Assuming that the first value in the view is 123.456, and is defined by the elements Jan and Widget
Expand( 'INSERT INTO SALES ( MONTH, PRODUCT, SALES ) VALUES ("%V0%", "%V1%",%V2% )' )
'INSERTINTO SALES ( MONTH, PRODUCT, SALES ) VALUES ( Jan, Widget,123.456 )'
at run time.