Inserting Variables

From Starfish ETL
Jump to navigation Jump to search

Overview

Variables that have been created during an Exec Before/After Operation can be inserted as the end-result value in any kind of Function Field. Place your cursor inside the text box, and click the “Insert Variable” link.

From this list, you can choose a User-Defined variable, any Origin field, any Destination field (that comes before it in the sort order, and that has been assigned a value), or a Special Character. At run-time, the Starfish Engine will “replace” the variable code with the actual value for the current Origin row.

System Generated Variables

There are 3 system generated variables that can be used throughout Sugar.

Variable Description
[Row Hash Code] Found in the Origin Variable Class, the [Row Hash Code] is added to scripts as @@ORG:#RowHashCode@@.
Row Hash Code is a run-time generated MD5 hash of the entire row's data.
This is useful when you don't have a last modified date in your origin. You can store it and on the next run of the Job, compare the hash to see if the record changed instead of having to compare each individual field.
***THIS ONLY WORKS IN VBSCRIPT. DO NOT USE WITH C#, JAVASCRIPT, OR PERL.***
Job Argument Found in the User-Defined Variable Class, the Job Argument is added to scripts as @@VAR:JobArgument@@.
Job Arguments can be passed to Starfish by a 3rd party application when starting a job manually via web services.
Last Run Date Found in the User-Defined Variable Class, the Job Argument is added to scripts as @@VAR:LastRunDate@@.
Last Run date stores the last time a job was run. This is useful for Origin Queries where you want to find all records in the source that were modified after the last time the Job ran.
EX: date_modified >= '@@VAR:LastRunDate@@'