Skip to main content
Hi, I have a reader and writer to load and re-project a shapefile into MS SQL Spatial 2008 R2.  All good.  Now I want to run an existing stored procedure once after the file loads correctly.  The stored proc has no parameters.  Help greatly appreciated.

 

FME Desktop 2012 SP3
There are a few transformers that can execute on-the-fly SQL statements for example, check out the SQLExecutor and FeatureReader. However, these would be executed as the shape file is being uploaded to SQL Server. 

 

 

For things to be performed AFTER a FME process has finished, I'd recommend the usage of either a Python Shutdown Script (check the Advanced Workspace parameters in the Navigator section) or a batch script which first executes the FME workbench and afterwards executes the stored proc.

 

 

If your stored procedure isn't SQL based and is rather a macro defined only in SQL Server that neither FME or command prompt can access, you may need to look at a more programmatic approach based around SQL Server itself rather than FME.
Trying to use only FME I usually use either a python-script (with MSSQL libraries for python installed) or more preferred a second workspace and a WorkspaceRunner. This way I have more controll over the situation when it sometimes fails.
Hi,

 

 

I would use a WorkSpaceRunner to load the Shape file and attach a SQLExecutor at the SUCCEDED port of the WorkSpaceRunner.

 

This way the SQL will be executed only if the loading succeeds.

 

The WorkSpaceRunner can be triggered by using a Creator (once) of a FilePathReader for every Shape file in a directory.

 

 

Kind regards,

 

Erik Jan Bodewitz

Reply