GetEnvironment(“APT_RDBMS_COMMIT_ROWS”) | Returns the value of the given environment variable. If you queried the value of the environment variable name APT_RDBMS_COMMIT_ROWS then the following derivation might return the value “2048”. |
SavedRecordIndex: GetSavedInputRecord() | The following example is the derivation of a loop variable named SavedRecordIndex in a Transformer stage: |
NextSKChain(180858) | This function is used in the Slowly Changing Dimension stage as the derivation for a column with the SKChain purpose code. The function is not used in the Transformer stage. NextSKChain returns the value of the surrogate key column for the next row in the chain, or the value that has been specified to use for the last record in the chain |
NextSurrogateKey() | Returns the value of the next surrogate key. You must have previously set up your surrogate key source, and defined details on the Surrogate Key tab of the Stage page of the Transformer properties window |
PrevSKChain(121060) | This function is used in the Slowly Changing Dimension stage as the derivation for a column with the SKChain purpose code. The function is not used in the Transformer stage. PrevSKChain Returns the value of the surrogate key column for the previous record in the chain, or the value that has been specified to use for the first record in the chain |
NumSavedRecords: SaveInputRecord() | This function is used to implement the aggregating of data on the input link of a Transformer stage. You call the SaveInputRecord function to save a copy of the current input row to a cache area. The function returns the count of records in the cache, starting from 1. You can call SaveInputRecord from within the derivation of a stage variable in the Transformer stage. You can call SaveInputRecord multiple times for the same input row. The first call adds the input row to the cache and each subsequent call adds a duplicate of that same input row into the cache. So, for example, if SaveInputRecord is called three times for one input record, then the cache will contain three rows, each identical to the original input row. Use the GetSavedInputRecord function to retrieve the rows that you have stored |
Utility functions in Datastage
Reading Time: 2 minutes