Concatenating or Combining Published Parameters
Article Number: 000002037 - Last Modified: Oct 7, 2011
You can combine published parameters to form more complex parameter values. This example illustrates how to build a database WHERE clause so the user only enters (or chooses) the input value and parameters are concatenated to form the full WHERE clause
Concatenating Published Parameter
The user wants to select a city grid tile from a SQL Server database using a where clause WHERE :
CITY_GRID_ID = <grid id value>
How do we let the user enter just the tile number and then get FME to execute the complete where clause? A workspace is attached to illustrate the solution.
You can concatenate the parameters. The steps are:
- create a custom parameter so the user can enter or select the city grid tile ID. In the workspace this is the GRIDID published parameter.
We now need to apply this parameter to the WHERE Clause parameter on the SQL Server reader.
- Edit the parameter that needs to include the GRIDID and make the default setting the WHERE cluse you need. In the workspace this is the SQL Server WHERE parameter. Just include the parameter you created above using this syntax - $(GRIDID). So the WHERE clause becomes:
CITY_GRID_ID = $(GRIDID)
In the FME workspace you see the result of the GRIDID (14) which is a little confusing. To see the actual syntax you have to edit the WHERE Clause: parameter
The attached workspace also illustrates more complex scripted parameters using the GROUPS & the GROUP_FEATURE_TYPES parameters
|
Suggested Similar Articles