span8
span4
span8
span4
Hi,
I would like to create an output folder based on the input file.
I created a user variable
Below is the error that I'm getting using this workspaceoracle-spatial2mapinfo.fmw
INCLUDE -- failed to evaluate Python script `def ParamFunc(): import fmeobject def output_folder(feature): feature = FME_MacroValues['featuretypes'] string='C:\Users\Administrateur\Documents\oracle_spatial\tmp' if feature[10:]=='roads' output_folder=string+'\shape' else output_folder=string+'\mapinfo' return str(output_folder)value = ParamFunc()macroName = 'output_folder'if value == None: return { macroName : '' }else: return { macroName : str(value) }'Program TerminatingTranslation FAILED.File "",line 5 feature = FME_MacroValues['featuretypes'] ^IndentationError: expected an indented block
Thanks
As an easy solution,I think you can use a Tester transformer to filter out unnecessary features - i.e."unpaved" road features.Since the road features have "state" attribute storing "paved" or "unpaved",the condition for required features would be: the source table name does not end with "roads" OR the value of "state" is equal to "paved".
SQLExecutor Parameters
In this case,you can add an Oracle Spatial reader as a Workspace Resource in order to derive the destination schema from the existing database.And source table name - which will be used as the schema definition name and the destination feature type name in the dynamic writer feature types,can be propagated from the initiator feature for each SQLExecutor to the result features.
Regarding Workspace Resources,see these articles to learn more.
I remove the line "def output_folder" as suggested by @takashi and @david_r but it did not fixed the issue.
The problem is that featuretype is a list of tables read from another oracle table.I was first thinking of creating another column in the table MYTABLESLISTV that will contain the output folder for each oracle spatial object processed.Because I wasn't able do to that,I tried to write the above script.
Any thoughts?
The error messageIndentationError: expected an indented blockindicates that a code block (the definition of a function calledoutput_folderin this script) doesn't have appropriate indentations.In Python scripts,indentations have to be inserted with strictly conforming to Python syntax specifications.
That is the direct reason for the error,but it doesn't seem to be necessary to define the function in this case.What do you intend to perform with this line?
def output_folder(feature):
© 2019 亚搏在线Safe Software Inc |Legal