In my Aggregator transformer that I use to prepare and build a SQL query to next feed into SQLExecuter query, I want first to check if the primary key values are of type string in order to pad single quote for each value..
(example:
value1, value2, value3, ..for numeric primary keys
'value1','value2','value3', ..for string primary keys
)
So I chose to create a Scripted (Python) private parameter to check whether the primary key values of type string, then return a single quote as below:
snglq= ","
# Check if the primary key is string?
if type(FME_MacroValuesn'SDE_PK']) == str:
#then add a single quote
snglq= "','"
else:
# no single quote
snglq= ","
return snglq
And then assign value returned to the Separator Character box in Aggregator transformer, as shown below:
But that's not working properly, always result in values with padded single quote, yet the primary key values are of type numeric!!
What would be wrong here, please help