User Guide : Scripting : Script Statements : Source Query Statement
 
Share this page             
Source Query Statement
The source query statement requires that the variable be in scope before you run the transformation. For details, search for "record events" and "transformation events" in the documentation.
In our example above, the variable "var" must be instantiated and set prior to source connection. Otherwise, Select Case does not find a matching value, defaults to start = "" and returns the entire record set. To instantiate and set "var", here are a few options:
Use a Private variable from a process to pass the value into the map.
Use the FileRead() function to read an initialization file and set variable values by parsing the values into the appropriate variable to dynamically build the SQL statements. See FileRead Function.